Skip to content

Commit

Permalink
feat: changes and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed May 25, 2024
1 parent fbe2c09 commit 1eb6331
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 46 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
org.gradle.debug=false

mod_version=1.0.10
mod_version=1.0.11

# Mod
mod_id=zenith
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package net.zepalesque.zenith.api.blockset;

import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.MapColor;
import net.neoforged.neoforge.registries.DeferredBlock;
import net.neoforged.neoforge.registries.DeferredRegister;
import net.zepalesque.zenith.api.blockset.util.CraftingMatrix;

import java.util.function.Supplier;

public abstract class AbstractStoneSet implements BlockSet {

protected abstract DeferredBlock<?> baseBlock(DeferredRegister.Blocks registry, String id, MapColor color, SoundType soundType);
public abstract DeferredBlock<?> baseBlock();

protected abstract DeferredBlock<?> wallBlock(DeferredRegister.Blocks registry, String id, MapColor color, SoundType soundType);
public abstract DeferredBlock<?> wallBlock();

protected abstract DeferredBlock<?> stairsBlock(DeferredRegister.Blocks registry, String id, MapColor color, SoundType soundType);
public abstract DeferredBlock<?> stairsBlock();

protected abstract DeferredBlock<?> slabBlock(DeferredRegister.Blocks registry, String id, MapColor color, SoundType soundType);
public abstract DeferredBlock<?> slabBlock();

protected abstract void craftsInto(AbstractStoneSet set, CraftingMatrix shape);

protected abstract void craftsInto(Supplier<Block> block, CraftingMatrix shape);

protected abstract void stonecutInto(AbstractStoneSet set);

protected abstract void stonecutInto(Supplier<Block> block);

protected abstract void smeltsInto(AbstractStoneSet set, float experience);

protected abstract void smeltsInto(Supplier<Block> block, float experience);

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package net.zepalesque.zenith.api.blockset;

import net.minecraft.data.tags.EntityTypeTagsProvider;
import net.minecraft.data.tags.ItemTagsProvider;
import net.minecraft.tags.TagKey;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.properties.BlockSetType;
Expand All @@ -26,7 +27,7 @@
/**
* Should implement methods by having the first of each (with the parameters) used as a construction method and the second (without parameters) as a getter function
*/
public abstract class BaseWoodSet implements BlockSet, WoodSetNamed {
public abstract class AbstractWoodSet implements BlockSet, WoodSetNamed {

// Blocks

Expand Down Expand Up @@ -116,6 +117,12 @@ public abstract class BaseWoodSet implements BlockSet, WoodSetNamed {
protected abstract WoodType woodType(String id, BlockSetType type, SoundType sound);
public abstract WoodType woodType();

protected abstract TagKey<Item> logsTag(String id);
public abstract TagKey<Item> logsTag();

protected abstract TagKey<Block> logsBlockTag(String id);
public abstract TagKey<Block> logsBlockTag();


public Supplier<Item> getStick() {
return () -> Items.STICK;
Expand All @@ -128,6 +135,6 @@ public Supplier<Item> getStick() {
* @param data the {@link EntityTypeTagsProvider} used
*/
public abstract void entityTagData(EntityTypeTagsProvider data);

}

34 changes: 0 additions & 34 deletions src/main/java/net/zepalesque/zenith/api/blockset/BaseStoneSet.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.zepalesque.zenith.api.blockset;

import net.minecraft.data.loot.BlockLootSubProvider;
import net.minecraft.data.recipes.RecipeOutput;
import net.minecraft.data.recipes.RecipeProvider;
import net.minecraft.data.tags.ItemTagsProvider;
import net.neoforged.neoforge.client.model.generators.BlockStateProvider;
Expand Down Expand Up @@ -35,8 +36,9 @@ public interface BlockSet {
/**
* Generate recipe data for this BlockSet
* @param data the {@link RecipeProvider} used
* @param output the {@link RecipeOutput} that the recipe provider uses
*/
void recipeGen(RecipeProvider data);
void recipeGen(RecipeProvider data, RecipeOutput output);

/**
* Generate block tag data for this BlockSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public interface WoodSetNamed {
public String treesName(boolean isPlural);

public static enum LangType {
ID, LANG, LANG_PLURAL
ID, PLURAL, LANG, LANG_PLURAL
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.zepalesque.zenith.api.blockset.BaseWoodSet;
import net.zepalesque.zenith.api.blockset.AbstractWoodSet;

import javax.annotation.Nonnull;

public class ZenithBoat extends Boat implements ZenithBoatBehavior {
private BaseWoodSet set;
private AbstractWoodSet set;
public ZenithBoat(EntityType<? extends ZenithBoat> type, Level level) {
super(type, level);
}

public ZenithBoat(BaseWoodSet set, Level level, double x, double y, double z) {
public ZenithBoat(AbstractWoodSet set, Level level, double x, double y, double z) {
this(set.boatEntity().get(), level);
this.setPos(x, y, z);
this.xo = x;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.zepalesque.zenith.api.blockset.BaseWoodSet;
import net.zepalesque.zenith.api.blockset.AbstractWoodSet;

import javax.annotation.Nonnull;

public class ZenithChestBoat extends ChestBoat implements ZenithBoatBehavior {
private BaseWoodSet set;
private AbstractWoodSet set;
public ZenithChestBoat(EntityType<? extends ZenithChestBoat> type, Level level) {
super(type, level);
}

public ZenithChestBoat(BaseWoodSet set, Level level, double x, double y, double z) {
public ZenithChestBoat(AbstractWoodSet set, Level level, double x, double y, double z) {
this(set.chestBoatEntity().get(), level);
this.setPos(x, y, z);
this.xo = x;
Expand Down

0 comments on commit 1eb6331

Please sign in to comment.