Skip to content

Commit

Permalink
Merge branch 'unstable' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
hugeblank committed May 2, 2021
2 parents 42cf4f1 + 4bf3c9c commit 1d004fb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn_mappings=1.16.5+build.6
loader_version=0.11.3

# Mod Properties
mod_version = 0.3.1
mod_version = 0.3.2
maven_group = dev.elexi.hugeblank
archives_base_name = bagels_baking

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/dev/elexi/hugeblank/bagels_baking/Baking.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
import dev.elexi.hugeblank.bagels_baking.entity.VillagerTrades;
import dev.elexi.hugeblank.bagels_baking.item.*;
import dev.elexi.hugeblank.bagels_baking.recipe.MillingRecipe;
import dev.elexi.hugeblank.bagels_baking.screen.MillScreenHandler;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectionContext;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
import net.minecraft.block.*;
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityType;
Expand All @@ -23,6 +25,7 @@
import net.minecraft.recipe.CuttingRecipe;
import net.minecraft.recipe.RecipeSerializer;
import net.minecraft.recipe.RecipeType;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
Expand Down Expand Up @@ -233,6 +236,7 @@ private static boolean never(BlockState state, BlockView world, BlockPos pos) {
public static final Identifier INTERACT_WITH_MILL = new Identifier(ID, mill_stat);
public static RecipeType<MillingRecipe> MILLING;
public static RecipeSerializer<MillingRecipe> MILLING_SERIALIZER = RecipeSerializer.register(mill_rtype_id, new CuttingRecipe.Serializer(MillingRecipe::new));
public static ScreenHandlerType<MillScreenHandler> MILL_SCREEN;

// Ingredients
public static final Item SALT = basicIngredient();
Expand Down Expand Up @@ -500,6 +504,7 @@ public void onInitialize() {
Stats.CUSTOM.getOrCreateStat(INTERACT_WITH_MILL, StatFormatter.DEFAULT);
Registry.register(Registry.BLOCK, MILL_ID, MILL);
Registry.register(Registry.ITEM, MILL_ID, MILL_ITEM);
MILL_SCREEN = ScreenHandlerRegistry.registerSimple(Baking.MILL_ID, MillScreenHandler::new);

// Cups
registerItem("cup", CUP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,21 @@
import dev.elexi.hugeblank.bagels_baking.entity.TomatoEntity;
import dev.elexi.hugeblank.bagels_baking.network.TomatoSpawnPacket;
import dev.elexi.hugeblank.bagels_baking.screen.MillScreen;
import dev.elexi.hugeblank.bagels_baking.screen.MillScreenHandler;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
import net.fabricmc.fabric.api.network.ClientSidePacketRegistry;
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.entity.FlyingItemEntityRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.util.math.Vec3d;

import java.util.UUID;

public class ClientBaking implements ClientModInitializer {

public static ScreenHandlerType<MillScreenHandler> MILL_SCREEN;

@Override
public void onInitializeClient() {
BlockRenderLayerMap.INSTANCE.putBlock(Baking.HALITE, RenderLayer.getTranslucent());
Expand All @@ -39,8 +34,7 @@ public void onInitializeClient() {
BlockRenderLayerMap.INSTANCE.putBlock(Baking.CORN_STALK, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(Baking.RICE_PLANT, RenderLayer.getCutout());

MILL_SCREEN = ScreenHandlerRegistry.registerSimple(Baking.MILL_ID, MillScreenHandler::new);
ScreenRegistry.register(MILL_SCREEN, MillScreen::new);
ScreenRegistry.register(Baking.MILL_SCREEN, MillScreen::new);

EntityRendererRegistry.INSTANCE.register(Baking.TOMATO_THROWABLE, (dispatcher, context) ->
new FlyingItemEntityRenderer(dispatcher, context.getItemRenderer()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.google.common.collect.Lists;
import dev.elexi.hugeblank.bagels_baking.Baking;
import dev.elexi.hugeblank.bagels_baking.ClientBaking;
import dev.elexi.hugeblank.bagels_baking.recipe.MillingRecipe;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
Expand Down Expand Up @@ -44,7 +43,7 @@ public MillScreenHandler(int syncId, PlayerInventory playerInventory) {
}

public MillScreenHandler(int syncId, PlayerInventory playerInventory, ScreenHandlerContext context) {
super(ClientBaking.MILL_SCREEN, syncId);
super(Baking.MILL_SCREEN, syncId);
this.selectedRecipe = Property.create();
this.availableRecipes = Lists.newArrayList();
this.inputStack = ItemStack.EMPTY;
Expand Down Expand Up @@ -169,7 +168,7 @@ private void populateResult() {
}

public ScreenHandlerType<?> getType() {
return ClientBaking.MILL_SCREEN;
return Baking.MILL_SCREEN;
}

@Environment(EnvType.CLIENT)
Expand Down

0 comments on commit 1d004fb

Please sign in to comment.