-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from vrglab/dev/qol/Test-system
Dev/qol/test system
- Loading branch information
Showing
8 changed files
with
112 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.TestSystem; | ||
|
||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemGroup; | ||
import org.TestSystem.world.Blocks.TestBlocks; | ||
import org.TestSystem.world.Items.CreativeModeTabs; | ||
import org.TestSystem.world.Items.TestItems; | ||
|
||
public class TestMod { | ||
public static final String MODID = "vrglabslib"; | ||
|
||
public static void init(){ | ||
CreativeModeTabs.init(); | ||
TestItems.init(); | ||
TestBlocks.init(); | ||
} | ||
|
||
public static Item.Settings basicItemSettings() { | ||
return new Item.Settings().group(ItemGroup.DECORATIONS); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
1.19.2/common/src/main/java/org/TestSystem/world/Blocks/TestBlockEntity.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.TestSystem.world.Blocks; | ||
|
||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.block.entity.BlockEntityType; | ||
import net.minecraft.util.math.BlockPos; | ||
import org.Vrglab.Utils.Utils; | ||
|
||
public class TestBlockEntity extends BlockEntity { | ||
public TestBlockEntity(BlockPos pos, BlockState state) { | ||
super(Utils.convertToMcSafeType(TestBlocks.TEST_ENTITY_BLOCK_TYPE), pos, state); | ||
} | ||
|
||
|
||
} |
22 changes: 22 additions & 0 deletions
22
1.19.2/common/src/main/java/org/TestSystem/world/Blocks/TestBlocks.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.TestSystem.world.Blocks; | ||
|
||
import net.minecraft.block.AbstractBlock; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.Material; | ||
import org.TestSystem.TestMod; | ||
import org.Vrglab.Modloader.Registration.Registry; | ||
|
||
public class TestBlocks { | ||
|
||
public static Object TEST_BLOCK = Registry.RegisterBlock("test_block", TestMod.MODID, ()->new Block(AbstractBlock.Settings.of(Material.METAL)), TestMod.basicItemSettings()); | ||
public static Object TEST_ITEMLESS_BLOCK = Registry.RegisterItemlessBlock("test_itemless_block", TestMod.MODID, ()->new Block(AbstractBlock.Settings.of(Material.METAL))); | ||
|
||
public static Object TEST_POI_BLOCK = Registry.RegisterBlock("test_poi_block", TestMod.MODID, ()->new Block(AbstractBlock.Settings.of(Material.METAL)), TestMod.basicItemSettings()); | ||
public static Object TEST_ENTITY_BLOCK = Registry.RegisterBlock("test_entity_block", TestMod.MODID, ()->new TestEntityBlockHolder(AbstractBlock.Settings.of(Material.METAL)), TestMod.basicItemSettings()); | ||
|
||
public static Object TEST_ENTITY_BLOCK_TYPE = Registry.RegisterBlockEntityType("test_entity_block_type", TestMod.MODID, TestBlockEntity::new, TEST_ENTITY_BLOCK); | ||
|
||
public static void init() { | ||
|
||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
1.19.2/common/src/main/java/org/TestSystem/world/Blocks/TestEntityBlockHolder.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.TestSystem.world.Blocks; | ||
|
||
import net.minecraft.block.BlockEntityProvider; | ||
import net.minecraft.block.BlockRenderType; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.BlockWithEntity; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.util.math.BlockPos; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class TestEntityBlockHolder extends BlockWithEntity implements BlockEntityProvider { | ||
|
||
protected TestEntityBlockHolder(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { | ||
return new TestBlockEntity(pos, state); | ||
} | ||
|
||
@Override | ||
public BlockRenderType getRenderType(BlockState state) { | ||
return BlockRenderType.MODEL; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
1.19.2/common/src/main/java/org/TestSystem/world/Items/CreativeModeTabs.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.TestSystem.world.Items; | ||
|
||
public class CreativeModeTabs { | ||
|
||
public static void init(){ | ||
|
||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
1.19.2/common/src/main/java/org/TestSystem/world/Items/TestItems.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.TestSystem.world.Items; | ||
|
||
import net.minecraft.item.Item; | ||
import org.TestSystem.TestMod; | ||
import org.Vrglab.Modloader.Registration.Registry; | ||
|
||
public class TestItems { | ||
|
||
public static Object TEST_ITEM = Registry.RegisterItem("test_item", TestMod.MODID, ()->new Item(TestMod.basicItemSettings())); | ||
|
||
|
||
public static void init(){ | ||
|
||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package org.Vrglab; | ||
|
||
|
||
import org.TestSystem.TestMod; | ||
|
||
public final class VrglabsLib { | ||
|
||
public static void init() { | ||
|