Skip to content

Commit

Permalink
Updated to 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed Apr 3, 2022
1 parent be0e790 commit 18412ea
Show file tree
Hide file tree
Showing 22 changed files with 89 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
files-secondary: build/libs/*-@(dev|sources).jar
version-type: beta
loaders: forge
game-versions: 1.18.1
game-versions: 1.18.2
java: 17
name: ""
changelog: "https://github.com/Buuz135/SushiGoCrafting/commits/1.18"
Expand Down
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sourceSets.main.resources {
}

minecraft {
mappings channel: 'official', version: '1.18.1'
mappings channel: 'official', version: '1.18.2'
runs {
client = {
property 'mixin.env.remapRefMap', 'true'
Expand Down Expand Up @@ -85,14 +85,14 @@ repositories {
}

dependencies {
minecraft 'net.minecraftforge:forge:1.18.1-39.0.36'
compileOnly fg.deobf("mezz.jei:jei-1.18.1:9.2.1.69")
minecraft 'net.minecraftforge:forge:1.18.2-40.0.36'
compileOnly fg.deobf("mezz.jei:jei-1.18.2:9.5.5.174")
// at runtime, use the full JEI jar
runtimeOnly fg.deobf("mezz.jei:jei-1.18.1:9.2.1.69")
compileOnly fg.deobf ('com.hrznstudio:titanium:1.18-3.4.0-27')
runtimeOnly fg.deobf ('com.hrznstudio:titanium:1.18-3.4.0-27')
compileOnly fg.deobf("vazkii.patchouli:Patchouli:1.18.1-64:api")
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:1.18.1-64")
runtimeOnly fg.deobf("mezz.jei:jei-1.18.2:9.5.5.174")
compileOnly fg.deobf ('com.hrznstudio:titanium:1.18.2-3.5.0-32')
runtimeOnly fg.deobf ('com.hrznstudio:titanium:1.18.2-3.5.0-32')
compileOnly fg.deobf("vazkii.patchouli:Patchouli:1.18.2-67:api")
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:1.18.2-67")
//runtimeOnly fg.deobf("curse.maven:diet-443570:3300992")
//runtimeOnly fg.deobf("curse.maven:appleskin-248787:3395800")
compileOnly fg.deobf("com.blamejared.crafttweaker:CraftTweaker-forge-1.18.1:9.0.0+30")
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
org.gradle.jvmargs=-Xmx2G
modGroup=com.buuz135
modVersion=0.3.2
modVersion=0.3.3
modBaseName=sushigocrafting
minecraftVersion=1.18.1
minecraftVersion=1.18.2
27 changes: 14 additions & 13 deletions src/main/java/com/buuz135/sushigocrafting/SushiGoCrafting.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.buuz135.sushigocrafting.recipe.CuttingBoardRecipe;
import com.buuz135.sushigocrafting.recipe.FermentingBarrelRecipe;
import com.buuz135.sushigocrafting.tile.machinery.*;
import com.buuz135.sushigocrafting.world.SeaWeedFeatureHolders;
import com.buuz135.sushigocrafting.world.SushiTab;
import com.buuz135.sushigocrafting.world.tree.AvocadoTree;
import com.hrznstudio.titanium.event.handler.EventManager;
Expand All @@ -23,10 +24,8 @@
import com.hrznstudio.titanium.reward.Reward;
import com.hrznstudio.titanium.reward.RewardGiver;
import com.hrznstudio.titanium.reward.RewardManager;
import net.minecraft.core.BlockPos;
import net.minecraft.core.NonNullList;
import net.minecraft.data.tags.BlockTagsProvider;
import net.minecraft.data.worldgen.placement.PlacementUtils;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.Containers;
Expand All @@ -38,6 +37,7 @@
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.level.Level;
Expand All @@ -46,10 +46,6 @@
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.levelgen.GenerationStep;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.levelgen.blockpredicates.BlockPredicate;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
import net.minecraft.world.level.levelgen.placement.*;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent;
Expand Down Expand Up @@ -112,17 +108,22 @@ public SushiGoCrafting() {
CuttingBoardRecipe.SERIALIZER,
FermentingBarrelRecipe.SERIALIZER
)).subscribe();
for (IFoodType value : FoodAPI.get().getFoodTypes()) {
FoodHelper.generateFood(value).forEach(item -> SushiContent.Items.REGISTRY.register(FoodHelper.getName(item), () -> item));
}
EventManager.modGeneric(RegistryEvent.Register.class, Item.class).process(register -> {
for (IFoodType value : FoodAPI.get().getFoodTypes()) {
FoodHelper.generateFood(value).forEach(item -> {
var itemConfigured = item.setRegistryName(new ResourceLocation(MOD_ID, FoodHelper.getName(item)));
((RegistryEvent.Register<Item>) register).getRegistry().register(itemConfigured);
});
}
}).subscribe();
NBTManager.getInstance().scanTileClassForAnnotations(RollerTile.class);
NBTManager.getInstance().scanTileClassForAnnotations(RiceCookerTile.class);
NBTManager.getInstance().scanTileClassForAnnotations(CuttingBoardTile.class);
NBTManager.getInstance().scanTileClassForAnnotations(CoolerBoxTile.class);
NBTManager.getInstance().scanTileClassForAnnotations(FermentationBarrelTile.class);
EventManager.forge(BiomeLoadingEvent.class).filter(biomeLoadingEvent -> biomeLoadingEvent.getCategory() == Biome.BiomeCategory.OCEAN).process(biomeLoadingEvent -> {
biomeLoadingEvent.getGeneration().addFeature(GenerationStep.Decoration.VEGETAL_DECORATION,
SushiContent.Features.SEAWEED.get().configured(FeatureConfiguration.NONE).placed(NoiseBasedCountPlacement.of(80, 80.0D, 0.0D), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP_TOP_SOLID, BiomeFilter.biome()));
biomeLoadingEvent.getGeneration().addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, SeaWeedFeatureHolders.PLACEMENT);
//holder.configured(FeatureConfiguration.NONE).placed(NoiseBasedCountPlacement.of(80, 80.0D, 0.0D), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP_TOP_SOLID, BiomeFilter.biome()));
//.decorated(Features.Decorators.TOP_SOLID_HEIGHTMAP.squared().decorated(FeatureDecorator.COUNT_NOISE_BIASED.configured(new NoiseCountFactorDecoratorConfiguration(80, 80.0D, 0.0D)))));
}).subscribe();
EventManager.forge(BiomeLoadingEvent.class).filter(biomeLoadingEvent -> biomeLoadingEvent.getCategory() == Biome.BiomeCategory.OCEAN || biomeLoadingEvent.getCategory() == Biome.BiomeCategory.RIVER).process(biomeLoadingEvent -> {
Expand All @@ -135,8 +136,8 @@ public SushiGoCrafting() {
SpawnPlacements.register(SushiContent.EntityTypes.TUNA.get(), SpawnPlacements.Type.IN_WATER, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, AbstractFish::checkMobSpawnRules);
}).subscribe();
EventManager.forge(BiomeLoadingEvent.class).filter(biomeLoadingEvent -> biomeLoadingEvent.getCategory() == Biome.BiomeCategory.PLAINS).process(biomeLoadingEvent -> {
biomeLoadingEvent.getGeneration().addFeature(GenerationStep.Decoration.VEGETAL_DECORATION,
Feature.TREE.configured(AvocadoTree.TREE).placed(PlacementUtils.countExtra(0, 0.05F, 1), InSquarePlacement.spread(), SurfaceWaterDepthFilter.forMaxDepth(0), PlacementUtils.HEIGHTMAP_OCEAN_FLOOR, BlockPredicateFilter.forPredicate(BlockPredicate.wouldSurvive(Blocks.OAK_SAPLING.defaultBlockState(), BlockPos.ZERO)), BiomeFilter.biome()));
biomeLoadingEvent.getGeneration().addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AvocadoTree.PLACEMENT);
//Feature.TREE.configured(AvocadoTree.TREE).placed(PlacementUtils.countExtra(0, 0.05F, 1), InSquarePlacement.spread(), SurfaceWaterDepthFilter.forMaxDepth(0), PlacementUtils.HEIGHTMAP_OCEAN_FLOOR, BlockPredicateFilter.forPredicate(BlockPredicate.wouldSurvive(Blocks.OAK_SAPLING.defaultBlockState(), BlockPos.ZERO)), BiomeFilter.biome()));
//.decorated(Features.Decorators.HEIGHTMAP_SQUARE)
//.decorated(FeatureDecorator.CHANCE.configured(new ChanceDecoratorConfiguration(6))));
}).subscribe();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public class FoodIngredient implements IFoodIngredient {
public static FoodIngredient EMPTY = new FoodIngredient("empty", null, 0, IIngredientConsumer.WEIGHT, null, null, 0, 0, DietType.SUGARS);
public static FoodIngredient RICE = new FoodIngredient("rice", SushiContent.Items.COOKED_RICE, 30, IIngredientConsumer.WEIGHT, null, new ModifyIngredientEffect(1.75f, 0), 0, 2, DietType.GRAINS);
public static FoodIngredient NORI = new FoodIngredient("nori", SushiContent.Items.NORI_SHEET, 1, IIngredientConsumer.STACK, null, null, 1, 1, DietType.VEGETABLES);
public static FoodIngredient TUNA_FILLET = new FoodIngredient("tuna", SushiContent.Items.RAW_TUNA_FILLET, 30, IIngredientConsumer.WEIGHT, () -> Ingredient.of(ItemTags.createOptional(new ResourceLocation("forge", "raw_fishes/tuna"))), new AddIngredientEffect(SushiContent.Effects.ACQUIRED_TASTE, 30, 0), 3, 1, DietType.PROTEINS);
public static FoodIngredient SALMON_FILLET = new FoodIngredient("salmon", SushiContent.Items.RAW_SALMON_FILLET, 30, IIngredientConsumer.WEIGHT, () -> Ingredient.of(ItemTags.createOptional(new ResourceLocation("forge", "raw_fishes/salmon"))), new AddIngredientEffect(SushiContent.Effects.SMALL_BITES, 30, 0), 3, 1, DietType.PROTEINS);
public static FoodIngredient AVOCADO = new FoodIngredient("avocado", SushiContent.Items.AVOCADO_SLICES, 45, IIngredientConsumer.WEIGHT, () -> Ingredient.of(ItemTags.createOptional(new ResourceLocation("forge", "fruits/avocado"))), new ModifyIngredientEffect(1.20f, 1), 2, 2, DietType.FRUITS);
public static FoodIngredient CUCUMBER = new FoodIngredient("cucumber", SushiContent.Items.CUCUMBER_SLICES, 15, IIngredientConsumer.WEIGHT, () -> Ingredient.of(ItemTags.createOptional(new ResourceLocation("forge", "crops/cucumber"))), new ModifyIngredientEffect(1.25f, 0), 2, 2, DietType.VEGETABLES);
public static FoodIngredient TUNA_FILLET = new FoodIngredient("tuna", SushiContent.Items.RAW_TUNA_FILLET, 30, IIngredientConsumer.WEIGHT, () -> Ingredient.of(ItemTags.create(new ResourceLocation("forge", "raw_fishes/tuna"))), new AddIngredientEffect(SushiContent.Effects.ACQUIRED_TASTE, 30, 0), 3, 1, DietType.PROTEINS);
public static FoodIngredient SALMON_FILLET = new FoodIngredient("salmon", SushiContent.Items.RAW_SALMON_FILLET, 30, IIngredientConsumer.WEIGHT, () -> Ingredient.of(ItemTags.create(new ResourceLocation("forge", "raw_fishes/salmon"))), new AddIngredientEffect(SushiContent.Effects.SMALL_BITES, 30, 0), 3, 1, DietType.PROTEINS);
public static FoodIngredient AVOCADO = new FoodIngredient("avocado", SushiContent.Items.AVOCADO_SLICES, 45, IIngredientConsumer.WEIGHT, () -> Ingredient.of(ItemTags.create(new ResourceLocation("forge", "fruits/avocado"))), new ModifyIngredientEffect(1.20f, 1), 2, 2, DietType.FRUITS);
public static FoodIngredient CUCUMBER = new FoodIngredient("cucumber", SushiContent.Items.CUCUMBER_SLICES, 15, IIngredientConsumer.WEIGHT, () -> Ingredient.of(ItemTags.create(new ResourceLocation("forge", "crops/cucumber"))), new ModifyIngredientEffect(1.25f, 0), 2, 2, DietType.VEGETABLES);
public static FoodIngredient SESAME = new FoodIngredient("sesame", SushiContent.Items.SESAME_SEED, 6, IIngredientConsumer.WEIGHT, null, new ModifyIngredientEffect(2, 0), 1, 1, DietType.GRAINS);
public static FoodIngredient CRAB = new FoodIngredient("crab", SushiContent.Items.IMITATION_CRAB, 30, IIngredientConsumer.WEIGHT, () -> Ingredient.of(Items.COD), new AddIngredientEffect(() -> MobEffects.MOVEMENT_SPEED, 3, 0), 2, 1, DietType.PROTEINS);
public static FoodIngredient WAKAME = new FoodIngredient("wakame", () -> Items.SEAGRASS, 1, IIngredientConsumer.STACK, null, null, 0, 1, DietType.VEGETABLES);
Expand All @@ -32,7 +32,7 @@ public class FoodIngredient implements IFoodIngredient {
public static FoodIngredient SHRIMP = new FoodIngredient("shrimp", SushiContent.Items.SHRIMP, 30, IIngredientConsumer.WEIGHT, null, new AddIngredientEffect(SushiContent.Effects.STEADY_HANDS, 60, 0), 2, 1, DietType.PROTEINS);
public static FoodIngredient CHICKEN = new FoodIngredient("chicken", () -> Items.COOKED_CHICKEN, 30, IIngredientConsumer.WEIGHT, null, new AddIngredientEffect(() -> MobEffects.SLOW_FALLING, 10, 0), 2, 1, DietType.PROTEINS);
public static FoodIngredient SOY_SAUCE = new FoodIngredient("soy_sauce", SushiContent.Items.SOY_SAUCE, 4, IIngredientConsumer.WEIGHT, null, new ModifyIngredientEffect(1, 1), 0, 0, DietType.GRAINS);
public static FoodIngredient WASABI = new FoodIngredient("wasabi", SushiContent.Items.WASABI_PASTE, 4, IIngredientConsumer.WEIGHT, () -> Ingredient.of(ItemTags.createOptional(new ResourceLocation("forge", "crops/wasabi_root"))), new AddIngredientEffect(() -> MobEffects.FIRE_RESISTANCE, 10, 0), 0, 0, DietType.VEGETABLES);
public static FoodIngredient WASABI = new FoodIngredient("wasabi", SushiContent.Items.WASABI_PASTE, 4, IIngredientConsumer.WEIGHT, () -> Ingredient.of(ItemTags.create(new ResourceLocation("forge", "crops/wasabi_root"))), new AddIngredientEffect(() -> MobEffects.FIRE_RESISTANCE, 10, 0), 0, 0, DietType.VEGETABLES);

private final Supplier<? extends Item> item;
private final String name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.buuz135.sushigocrafting.block.machinery;

import com.buuz135.sushigocrafting.proxy.SushiContent;
import com.buuz135.sushigocrafting.tile.machinery.CoolerBoxTile;
import com.hrznstudio.titanium.block.RotatableBlock;
import net.minecraft.ChatFormatting;
Expand Down Expand Up @@ -49,12 +48,6 @@ public Item asItem() {
return Item.byBlock(this);
}

@Override
public BlockEntityType getTileEntityType() {
return SushiContent.TileEntities.COOLER_BOX.get();
}


@Nonnull
@Override
public RotationType getRotationType() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.buuz135.sushigocrafting.block.machinery;

import com.buuz135.sushigocrafting.proxy.SushiContent;
import com.buuz135.sushigocrafting.tile.machinery.CuttingBoardTile;
import com.hrznstudio.titanium.block.RotatableBlock;
import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -30,11 +29,6 @@ public BlockEntityType.BlockEntitySupplier<?> getTileEntityFactory() {
return CuttingBoardTile::new;
}

@Override
public BlockEntityType getTileEntityType() {
return SushiContent.TileEntities.CUTTING_BOARD.get();
}

@Override
public Item asItem() {
return Item.byBlock(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.buuz135.sushigocrafting.block.machinery;

import com.buuz135.sushigocrafting.proxy.SushiContent;
import com.buuz135.sushigocrafting.tile.machinery.FermentationBarrelTile;
import com.hrznstudio.titanium.block.RotatableBlock;
import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -51,11 +50,6 @@ public BlockEntityType.BlockEntitySupplier<?> getTileEntityFactory() {
return FermentationBarrelTile::new;
}

@Override
public BlockEntityType getTileEntityType() {
return SushiContent.TileEntities.FERMENTATION_BARREL.get();
}

@Override
public RotationType getRotationType() {
return RotationType.NONE;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.buuz135.sushigocrafting.block.machinery;

import com.buuz135.sushigocrafting.proxy.SushiContent;
import com.buuz135.sushigocrafting.tile.machinery.RiceCookerTile;
import com.hrznstudio.titanium.block.RotatableBlock;
import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -126,11 +125,6 @@ public BlockEntityType.BlockEntitySupplier<?> getTileEntityFactory() {
return RiceCookerTile::new;
}

@Override
public BlockEntityType getTileEntityType() {
return SushiContent.TileEntities.RICE_COOKER.get();
}

@Override
public RotationType getRotationType() {
return RotationType.FOUR_WAY;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.buuz135.sushigocrafting.block.machinery;

import com.buuz135.sushigocrafting.proxy.SushiContent;
import com.buuz135.sushigocrafting.tile.machinery.RollerTile;
import com.hrznstudio.titanium.block.RotatableBlock;
import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -37,11 +36,6 @@ public Item asItem() {
return Item.byBlock(this);
}

@Override
public BlockEntityType getTileEntityType() {
return SushiContent.TileEntities.ROLLER.get();
}

@Override
public void attack(BlockState state, Level worldIn, BlockPos pos, Player player) {
this.getTile(worldIn, pos).ifPresent(rollerTile -> rollerTile.onClick(player));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.IForgeShearable;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.registries.ForgeRegistries;

import java.util.Random;

Expand Down Expand Up @@ -60,7 +61,7 @@ private static BlockState updateDistance(BlockState state, LevelAccessor worldIn
}

private static int getDistance(BlockState neighbor) {
if (BlockTags.LOGS.contains(neighbor.getBlock())) {
if (ForgeRegistries.BLOCKS.tags().getTag(BlockTags.LOGS).contains(neighbor.getBlock())) {
return 0;
} else {
return neighbor.getBlock() instanceof AvocadoLeavesBlock || neighbor.getBlock() instanceof LeavesBlock ? neighbor.getValue(DISTANCE) : 7;
Expand Down
Loading

0 comments on commit 18412ea

Please sign in to comment.