generated from QuiltMC/quilt-template-mod
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean Up Codebase and Start Boulders #1
Open
peaceheis
wants to merge
5
commits into
DebuggyTeam:testing
Choose a base branch
from
peaceheis:1.19
base: testing
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8b7ca53
Clean Up Codebase
peaceheis 51edbb9
Codebase further cleaned up, but boulder generation very much broken
peaceheis 0886223
bumped version to the latest versions
KirboSoftware 7b24f1e
Don't use currently broken boulders, Add mossy rocks
peaceheis f2eb28b
Merge remote-tracking branch 'origin/1.19' into 1.19
peaceheis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 78 additions & 39 deletions
117
src/main/java/io/github/debuggyteam/wonders/block/WondersBlocks.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,100 @@ | ||
package io.github.debuggyteam.wonders.block; | ||
|
||
import io.github.debuggyteam.wonders.util.WondersRegistry; | ||
import io.github.debuggyteam.wonders.Wonders; | ||
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry; | ||
import net.fabricmc.fabric.api.registry.FuelRegistry; | ||
import net.fabricmc.fabric.api.registry.StrippableBlockRegistry; | ||
import net.minecraft.block.*; | ||
import net.minecraft.sound.BlockSoundGroup; | ||
import net.minecraft.util.registry.Registry; | ||
import org.quiltmc.qsl.block.extensions.api.QuiltBlockSettings; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class WondersBlocks { | ||
/** | ||
* Used to hold Blocks (type {@code Block}) and their names (type {@code String}) | ||
* </br></br> | ||
* Used by both {@code WondersBlocks} and {@code WondersItems} to allow for automatic creation of block items per-block. | ||
* @see io.github.debuggyteam.wonders.item.WondersItems#init | ||
*/ | ||
public static final Map<String, Block> BLOCKS = new HashMap<>(); | ||
/* | ||
Made by Joost | ||
*/ | ||
public static final Block TEST_BLOCK = WondersRegistry.registerBlock("test_block", createBlock(Material.WOOD, 2.0f)); | ||
|
||
// Palm tree logs | ||
public static final Block PALM_LOG = WondersRegistry.registerBlock("palm_log", new PillarBlock( | ||
QuiltBlockSettings.copy(Blocks.OAK_LOG).sounds(BlockSoundGroup.WOOD).strength(2.0f) | ||
)); | ||
public static final Block TEST_BLOCK = blockWithSettingsOf(Material.WOOD, 2.0f); | ||
|
||
public static final Block PALM_WOOD = WondersRegistry.registerBlock("palm_wood", new PillarBlock( | ||
QuiltBlockSettings.copy(Blocks.OAK_WOOD).sounds(BlockSoundGroup.WOOD).strength(2.0f) | ||
)); | ||
// Palm wood and crew | ||
public static final Block PALM_LOG = new PillarBlock(QuiltBlockSettings.copy(Blocks.OAK_LOG).sounds(BlockSoundGroup.WOOD).strength(2.0f)); | ||
public static final Block PALM_WOOD = new PillarBlock(QuiltBlockSettings.copy(Blocks.OAK_WOOD).sounds(BlockSoundGroup.WOOD).strength(2.0f)); | ||
public static final Block STRIPPED_PALM_LOG = new PillarBlock(QuiltBlockSettings.copy(Blocks.STRIPPED_OAK_LOG).sounds(BlockSoundGroup.WOOD).strength(2.0f)); | ||
public static final Block STRIPPED_PALM_WOOD = new PillarBlock(QuiltBlockSettings.copy(Blocks.STRIPPED_OAK_WOOD).sounds(BlockSoundGroup.WOOD).strength(2.0f)); | ||
public static final Block PALM_PLANKS = new Block(QuiltBlockSettings.copy(Blocks.OAK_PLANKS).sounds(BlockSoundGroup.WOOD).strength(2.0f)); | ||
public static final StairsBlock PALM_STAIRS = new StairsBlock(Blocks.OAK_PLANKS.getDefaultState(), QuiltBlockSettings.copy(Blocks.OAK_STAIRS).sounds(BlockSoundGroup.WOOD).strength(2.0f)); | ||
//TODO: add a Palm Fence Gate | ||
public static final FenceBlock PALM_FENCE = new FenceBlock(QuiltBlockSettings.copy(Blocks.OAK_FENCE).sounds(BlockSoundGroup.WOOD).strength(2.0f)); | ||
public static final SlabBlock PALM_SLAB = new SlabBlock(QuiltBlockSettings.copy(Blocks.OAK_SLAB).sounds(BlockSoundGroup.WOOD).strength(2.0f)); | ||
public static final TrapdoorBlock PALM_TRAPDOOR = new TrapdoorBlock(QuiltBlockSettings.copy(Blocks.OAK_TRAPDOOR).sounds(BlockSoundGroup.WOOD).strength(2.0f)); | ||
|
||
public static final Block STRIPPED_PALM_LOG = WondersRegistry.registerBlock("stripped_palm_log", new PillarBlock( | ||
QuiltBlockSettings.copy(Blocks.STRIPPED_OAK_LOG).sounds(BlockSoundGroup.WOOD).strength(2.0f) | ||
)); | ||
static { | ||
BLOCKS.put("test_block", TEST_BLOCK); | ||
BLOCKS.put("palm_log", PALM_LOG); | ||
BLOCKS.put("palm_wood", PALM_WOOD); | ||
BLOCKS.put("stripped_palm_log", STRIPPED_PALM_LOG); | ||
BLOCKS.put("stripped_palm_wood", STRIPPED_PALM_WOOD); | ||
BLOCKS.put("palm_planks", PALM_PLANKS); | ||
BLOCKS.put("palm_stairs", PALM_STAIRS); | ||
BLOCKS.put("palm_fence", PALM_FENCE); | ||
BLOCKS.put("palm_slab", PALM_SLAB); | ||
BLOCKS.put("palm_trapdoor", PALM_TRAPDOOR); | ||
} | ||
//TODO: palm sign? | ||
//public static final SignBlock PALM_SIGN = WondersRegistry.registerBlock("palm_sign", new SignBlock( | ||
// Blocks.OAK_PLANKS.getDefaultState(), QuiltBlockSettings.copy(Blocks.OAK_SIGN).sounds(BlockSoundGroup.WOOD).strength(2.0f) | ||
//)); | ||
|
||
public static final Block STRIPPED_PALM_WOOD = WondersRegistry.registerBlock("stripped_palm_wood", new PillarBlock( | ||
QuiltBlockSettings.copy(Blocks.STRIPPED_OAK_WOOD).sounds(BlockSoundGroup.WOOD).strength(2.0f) | ||
)); | ||
/** | ||
* To be used for creating a block with just the settings of a {@code Material} | ||
* @param material - the material to use for the block | ||
* @param strength - float value of strength | ||
* @see QuiltBlockSettings#of | ||
* @see Material | ||
*/ | ||
private static Block blockWithSettingsOf(Material material, Float strength){ | ||
return new Block(QuiltBlockSettings.of(material).strength(strength)); | ||
} | ||
|
||
// Palm tree planks | ||
public static final Block PALM_PLANKS = WondersRegistry.registerBlock("palm_planks", new Block( | ||
QuiltBlockSettings.copy(Blocks.OAK_PLANKS).sounds(BlockSoundGroup.WOOD).strength(2.0f) | ||
)); | ||
public static void init(){ | ||
//simple, innit? | ||
BLOCKS.forEach((String name, Block block) -> Registry.register(Registry.BLOCK, Wonders.ID(name), block)); | ||
|
||
public static final StairsBlock PALM_STAIRS = (StairsBlock) WondersRegistry.registerBlock("palm_stairs", new StairsBlock( | ||
Blocks.OAK_PLANKS.getDefaultState(), QuiltBlockSettings.copy(Blocks.OAK_STAIRS).sounds(BlockSoundGroup.WOOD).strength(2.0f) | ||
)); | ||
//TODO this has got to go soon. Use Tags and REAs. | ||
registerStrippableBlocks(); | ||
registerFlammables(); | ||
registerFuels(); | ||
} | ||
|
||
public static final FenceBlock PALM_FENCE = (FenceBlock) WondersRegistry.registerBlock("palm_fence", new FenceBlock( | ||
QuiltBlockSettings.copy(Blocks.OAK_FENCE).sounds(BlockSoundGroup.WOOD).strength(2.0f) | ||
)); | ||
private static void registerStrippableBlocks(){ | ||
StrippableBlockRegistry.register(PALM_LOG, STRIPPED_PALM_LOG); | ||
StrippableBlockRegistry.register(PALM_WOOD, STRIPPED_PALM_WOOD); | ||
} | ||
|
||
public static final SlabBlock PALM_SLAB = (SlabBlock) WondersRegistry.registerBlock("palm_slab", new SlabBlock( | ||
QuiltBlockSettings.copy(Blocks.OAK_SLAB).sounds(BlockSoundGroup.WOOD).strength(2.0f) | ||
)); | ||
private static void registerFuels() { | ||
FuelRegistry registry = FuelRegistry.INSTANCE; | ||
|
||
public static final TrapdoorBlock PALM_TRAPDOOR = (TrapdoorBlock) WondersRegistry.registerBlock("palm_trapdoor", new TrapdoorBlock( | ||
QuiltBlockSettings.copy(Blocks.OAK_TRAPDOOR).sounds(BlockSoundGroup.WOOD).strength(2.0f) | ||
)); | ||
registry.add(PALM_LOG, 300); | ||
registry.add(PALM_WOOD, 300); | ||
registry.add(STRIPPED_PALM_LOG, 300); | ||
registry.add(STRIPPED_PALM_WOOD, 300); | ||
} | ||
|
||
//public static final SignBlock PALM_SIGN = WondersRegistry.registerBlock("palm_sign", new SignBlock( | ||
// Blocks.OAK_PLANKS.getDefaultState(), QuiltBlockSettings.copy(Blocks.OAK_SIGN).sounds(BlockSoundGroup.WOOD).strength(2.0f) | ||
//)); | ||
private static void registerFlammables() { | ||
FlammableBlockRegistry flammableBocks = FlammableBlockRegistry.getDefaultInstance(); | ||
|
||
private static Block createBlock(Material material, Float strength){ | ||
return new Block(QuiltBlockSettings.of(material).strength(strength)); | ||
flammableBocks.add(PALM_LOG, 5, 5); | ||
flammableBocks.add(PALM_WOOD, 5, 5); | ||
flammableBocks.add(STRIPPED_PALM_LOG, 5, 5); | ||
flammableBocks.add(STRIPPED_PALM_WOOD, 5, 5); | ||
} | ||
|
||
public static void init(){} | ||
} |
31 changes: 14 additions & 17 deletions
31
src/main/java/io/github/debuggyteam/wonders/item/WondersItems.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,26 @@ | ||
package io.github.debuggyteam.wonders.item; | ||
|
||
import io.github.debuggyteam.wonders.Wonders; | ||
import io.github.debuggyteam.wonders.block.WondersBlocks; | ||
import io.github.debuggyteam.wonders.util.WondersRegistry; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.item.BlockItem; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.util.registry.Registry; | ||
|
||
|
||
public class WondersItems { | ||
// registering items | ||
public static Item TEST = WondersRegistry.registerItem("test"); | ||
public static Item TEST = new Item(new Item.Settings().group(Wonders.GROUP)); | ||
|
||
// registering block items | ||
public static Item TEST_BLOCK = WondersRegistry.registerBlockItem("test_block", WondersBlocks.TEST_BLOCK); | ||
public static void init(){ | ||
//dynamically register a new block item for every block. | ||
WondersBlocks.BLOCKS.forEach((String name, Block block) -> register(new BlockItem(block, new Item.Settings().group(Wonders.GROUP)), name)); | ||
|
||
// Palm logs | ||
public static Item PALM_LOG = WondersRegistry.registerBlockItem("palm_log", WondersBlocks.PALM_LOG); | ||
public static Item PALM_WOOD = WondersRegistry.registerBlockItem("palm_wood", WondersBlocks.PALM_WOOD); | ||
public static Item STRIPPED_PALM_LOG = WondersRegistry.registerBlockItem("stripped_palm_log", WondersBlocks.STRIPPED_PALM_LOG); | ||
public static Item STRIPPED_PALM_WOOD = WondersRegistry.registerBlockItem("stripped_palm_wood", WondersBlocks.STRIPPED_PALM_WOOD); | ||
//regular Items | ||
register(TEST, "test_item"); | ||
} | ||
|
||
// Palm planks | ||
public static Item PALM_PLANKS = WondersRegistry.registerBlockItem("palm_planks", WondersBlocks.PALM_PLANKS); | ||
public static Item PALM_STAIRS = WondersRegistry.registerBlockItem("palm_stairs", WondersBlocks.PALM_STAIRS); | ||
public static Item PALM_FENCE = WondersRegistry.registerBlockItem("palm_fence", WondersBlocks.PALM_FENCE); | ||
public static Item PALM_SLAB = WondersRegistry.registerBlockItem("palm_slab", WondersBlocks.PALM_SLAB); | ||
public static Item PALM_TRAPDOOR = WondersRegistry.registerBlockItem("palm_trapdoor", WondersBlocks.PALM_TRAPDOOR); | ||
|
||
public static void init(){} | ||
private static <T extends Item> void register(T item, String name) { | ||
Registry.register(Registry.ITEM, Wonders.ID(name), item); | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
src/main/java/io/github/debuggyteam/wonders/mixin/TitleScreenMixin.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
src/main/java/io/github/debuggyteam/wonders/util/WondersRegistry.java
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
src/main/java/io/github/debuggyteam/wonders/util/WondersUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,5 @@ | ||
package io.github.debuggyteam.wonders.util; | ||
|
||
import io.github.debuggyteam.wonders.block.WondersBlocks; | ||
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry; | ||
import net.fabricmc.fabric.api.registry.FuelRegistry; | ||
import net.fabricmc.fabric.api.registry.StrippableBlockRegistry; | ||
|
||
public class WondersUtils { | ||
|
||
public static void registerUtils() { | ||
registerFuels(); | ||
registerStrippableBlocks(); | ||
registerFlammables(); | ||
} | ||
|
||
private static void registerFuels() { | ||
FuelRegistry registry = FuelRegistry.INSTANCE; | ||
|
||
registry.add(WondersBlocks.PALM_LOG, 300); | ||
registry.add(WondersBlocks.PALM_WOOD, 300); | ||
registry.add(WondersBlocks.STRIPPED_PALM_LOG, 300); | ||
registry.add(WondersBlocks.STRIPPED_PALM_WOOD, 300); | ||
} | ||
|
||
private static void registerStrippableBlocks(){ | ||
StrippableBlockRegistry.register(WondersBlocks.PALM_LOG, WondersBlocks.STRIPPED_PALM_LOG); | ||
StrippableBlockRegistry.register(WondersBlocks.PALM_WOOD, WondersBlocks.STRIPPED_PALM_WOOD); | ||
} | ||
|
||
private static void registerFlammables() { | ||
FlammableBlockRegistry flammableBocks = FlammableBlockRegistry.getDefaultInstance(); | ||
|
||
flammableBocks.add(WondersBlocks.PALM_LOG, 5, 5); | ||
flammableBocks.add(WondersBlocks.PALM_WOOD, 5, 5); | ||
flammableBocks.add(WondersBlocks.STRIPPED_PALM_LOG, 5, 5); | ||
flammableBocks.add(WondersBlocks.STRIPPED_PALM_WOOD, 5, 5); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this file still exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking the stuff that used to exist in the utils file got moved or will have a different implementation. Currently this is what exists in the main repo: https://github.com/DebuggyTeam/wonders/blob/1.19/src/main/java/io/github/debuggyteam/wonders/util/WondersUtils.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, however in that case shouldn't it just be yeeted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, I'll ask snooze about it on the dev chat since snooze was the one who made the PR.