wip wall logic and models + moved generation for block into separate classes for better readability

This commit is contained in:
2024-04-12 01:03:47 +02:00
parent b05c0ebd42
commit 6f394bbe6f
82 changed files with 2055 additions and 1578 deletions

View File

@@ -2,23 +2,17 @@ package fr.adrien1106.reframed.item;
import fr.adrien1106.reframed.ReFramed;
import fr.adrien1106.reframed.block.ReFramedEntity;
import fr.adrien1106.reframed.generator.RecipeSetter;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
import net.minecraft.block.Blocks;
import net.minecraft.data.server.recipe.RecipeExporter;
import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUsageContext;
import net.minecraft.item.Items;
import net.minecraft.recipe.book.RecipeCategory;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.ActionResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class ReFramedBlueprintItem extends Item implements RecipeSetter {
public class ReFramedBlueprintItem extends Item {
public ReFramedBlueprintItem(Settings settings) {
super(settings);
}
@@ -39,17 +33,4 @@ public class ReFramedBlueprintItem extends Item implements RecipeSetter {
return ActionResult.SUCCESS;
}
@Override
public void setRecipe(RecipeExporter exporter) {
ShapedRecipeJsonBuilder
.create(RecipeCategory.TOOLS, this, 3)
.pattern("PI")
.pattern("PP")
.input('P', Items.PAPER)
.input('I', Items.INK_SAC)
.criterion(FabricRecipeProvider.hasItem(Items.PAPER), FabricRecipeProvider.conditionsFromItem(Items.PAPER))
.criterion(FabricRecipeProvider.hasItem(this), FabricRecipeProvider.conditionsFromItem(this))
.offerTo(exporter);
}
}

View File

@@ -2,26 +2,20 @@ package fr.adrien1106.reframed.item;
import fr.adrien1106.reframed.ReFramed;
import fr.adrien1106.reframed.block.ReFramedDoubleBlock;
import fr.adrien1106.reframed.generator.RecipeSetter;
import fr.adrien1106.reframed.util.blocks.ThemeableBlockEntity;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.data.server.recipe.RecipeExporter;
import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUsageContext;
import net.minecraft.item.Items;
import net.minecraft.recipe.book.RecipeCategory;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.ActionResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class ReFramedHammerItem extends Item implements RecipeSetter {
public class ReFramedHammerItem extends Item {
public ReFramedHammerItem(Settings settings) {
super(settings);
}
@@ -52,19 +46,4 @@ public class ReFramedHammerItem extends Item implements RecipeSetter {
ReFramed.chunkRerenderProxy.accept(world, pos);
return ActionResult.SUCCESS;
}
@Override
public void setRecipe(RecipeExporter exporter) {
ShapedRecipeJsonBuilder
.create(RecipeCategory.TOOLS, this)
.pattern(" CI")
.pattern(" ~C")
.pattern("~ ")
.input('I', Items.IRON_INGOT)
.input('C', ReFramed.CUBE)
.input('~', Items.STICK)
.criterion(FabricRecipeProvider.hasItem(ReFramed.CUBE), FabricRecipeProvider.conditionsFromItem(ReFramed.CUBE))
.criterion(FabricRecipeProvider.hasItem(this), FabricRecipeProvider.conditionsFromItem(this))
.offerTo(exporter);
}
}

View File

@@ -2,17 +2,11 @@ package fr.adrien1106.reframed.item;
import fr.adrien1106.reframed.ReFramed;
import fr.adrien1106.reframed.block.ReFramedDoubleBlock;
import fr.adrien1106.reframed.generator.RecipeSetter;
import fr.adrien1106.reframed.util.blocks.ThemeableBlockEntity;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
import net.minecraft.block.BlockState;
import net.minecraft.data.server.recipe.RecipeExporter;
import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemUsageContext;
import net.minecraft.item.Items;
import net.minecraft.recipe.book.RecipeCategory;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundCategory;
import net.minecraft.state.property.Properties;
@@ -21,7 +15,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.World;
public class ReFramedScrewdriverItem extends Item implements RecipeSetter {
public class ReFramedScrewdriverItem extends Item {
public ReFramedScrewdriverItem(Settings settings) {
super(settings);
@@ -61,18 +55,4 @@ public class ReFramedScrewdriverItem extends Item implements RecipeSetter {
ReFramed.chunkRerenderProxy.accept(world, pos);
return ActionResult.SUCCESS;
}
@Override
public void setRecipe(RecipeExporter exporter) {
ShapedRecipeJsonBuilder
.create(RecipeCategory.TOOLS, this)
.pattern(" I")
.pattern(" I ")
.pattern("C ")
.input('I', Items.IRON_INGOT)
.input('C', ReFramed.CUBE)
.criterion(FabricRecipeProvider.hasItem(ReFramed.CUBE), FabricRecipeProvider.conditionsFromItem(ReFramed.CUBE))
.criterion(FabricRecipeProvider.hasItem(this), FabricRecipeProvider.conditionsFromItem(this))
.offerTo(exporter);
}
}