generated from NeoForgeMDKs/MDK-1.21-NeoGradle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
MCZME
committed
Aug 12, 2024
1 parent
db07960
commit 3804ccf
Showing
28 changed files
with
549 additions
and
22 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d
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,4 +1,5 @@ | ||
// 1.21 2024-08-10T17:07:03.6586838 Loot Tables | ||
// 1.21 2024-08-13T03:55:33.7091711 Loot Tables | ||
032b2242788b8411178136ca48214246ef2af8a9 data/lingshi/loot_table/blocks/chopping_board.json | ||
67cc122cf5e7e5865ff9bc81fec6e8371225b0d6 data/lingshi/loot_table/blocks/skillet.json | ||
c843630bb0739aad37078f0119c9cc31f5316c3a data/lingshi/loot_table/blocks/tea_leaf.json | ||
3cd0ced47f090fec162cddcb8b2f75284fa134cb data/lingshi/loot_table/blocks/tea_tree.json |
3 changes: 2 additions & 1 deletion
3
src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24
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,7 @@ | ||
// 1.21 2024-08-12T10:19:52.413361 Item Models: lingshi | ||
// 1.21 2024-08-13T04:10:11.5053055 Item Models: lingshi | ||
bad0cb5e093fa42331c2d4a1157d1a7b5b3fc588 assets/lingshi/models/item/chopping_board.json | ||
249957a6811e300efca306db358e468855851d73 assets/lingshi/models/item/iron_knife.json | ||
496d711c2d4af0f851d40f859b102da69188089d assets/lingshi/models/item/rice.json | ||
abe8ae1523c26af167289fe958382b2477d96ea1 assets/lingshi/models/item/rice_of_ear.json | ||
57cfb1f90de649ab0f56f107cb56e1d0d2f87ae6 assets/lingshi/models/item/rice_seedling.json | ||
cff85c127954ba63ac8129929c0d7346bf8f305d assets/lingshi/models/item/skillet.json |
4 changes: 2 additions & 2 deletions
4
src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361
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,2 +1,2 @@ | ||
// 1.21 2024-08-11T20:03:29.7270915 Languages: zh_cn for mod: lingshi | ||
ceb883a13057e1c30eaabbc27de7a3819e5e58b5 assets/lingshi/lang/zh_cn.json | ||
// 1.21 2024-08-13T03:55:33.7111786 Languages: zh_cn for mod: lingshi | ||
6691b4e3de41dca51664777d2790f94bd059d1ac assets/lingshi/lang/zh_cn.json |
3 changes: 2 additions & 1 deletion
3
src/generated/resources/.cache/d88813880ae3e40e9724fa9bc86e438c1f5ddb3d
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,3 +1,4 @@ | ||
// 1.21 2024-08-11T19:15:15.9707849 Tags for minecraft:block mod id lingshi | ||
// 1.21 2024-08-13T03:35:37.9402366 Tags for minecraft:block mod id lingshi | ||
639716446e0ad4bc759f5d086b91d0e4a9215ab7 data/lingshi/tags/block/can_support.json | ||
8f3ae1f87856cf69d686ec0be92f6b700f51bd30 data/lingshi/tags/block/heat_source.json | ||
e00d57f2828f9f55903e8c8c9f4b95dfeca4135d data/minecraft/tags/block/mineable/axe.json |
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
3 changes: 3 additions & 0 deletions
3
src/generated/resources/assets/lingshi/models/item/skillet.json
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,3 @@ | ||
{ | ||
"parent": "lingshi:block/skillet" | ||
} |
21 changes: 21 additions & 0 deletions
21
src/generated/resources/data/lingshi/loot_table/blocks/skillet.json
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 @@ | ||
{ | ||
"type": "minecraft:block", | ||
"pools": [ | ||
{ | ||
"bonus_rolls": 0.0, | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:survives_explosion" | ||
} | ||
], | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "lingshi:skillet" | ||
} | ||
], | ||
"rolls": 1.0 | ||
} | ||
], | ||
"random_sequence": "lingshi:blocks/skillet" | ||
} |
5 changes: 5 additions & 0 deletions
5
src/generated/resources/data/lingshi/tags/block/can_support.json
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,5 @@ | ||
{ | ||
"values": [ | ||
"minecraft:campfire" | ||
] | ||
} |
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
106 changes: 106 additions & 0 deletions
106
src/main/java/mczme/lingshi/common/block/SkilletBlock.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,106 @@ | ||
package mczme.lingshi.common.block; | ||
|
||
import com.mojang.serialization.MapCodec; | ||
import mczme.lingshi.common.block.entity.SkilletBlockEntity; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.InteractionHand; | ||
import net.minecraft.world.InteractionResult; | ||
import net.minecraft.world.ItemInteractionResult; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.context.BlockPlaceContext; | ||
import net.minecraft.world.level.BlockGetter; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.LevelAccessor; | ||
import net.minecraft.world.level.LevelReader; | ||
import net.minecraft.world.level.block.BaseEntityBlock; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.minecraft.world.level.block.RenderShape; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.block.state.StateDefinition; | ||
import net.minecraft.world.level.block.state.properties.BlockStateProperties; | ||
import net.minecraft.world.level.block.state.properties.BooleanProperty; | ||
import net.minecraft.world.level.block.state.properties.DirectionProperty; | ||
import net.minecraft.world.phys.BlockHitResult; | ||
import net.minecraft.world.phys.shapes.CollisionContext; | ||
import net.minecraft.world.phys.shapes.Shapes; | ||
import net.minecraft.world.phys.shapes.VoxelShape; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import static mczme.lingshi.common.tag.ModTags.CAN_SUPPORT; | ||
|
||
public class SkilletBlock extends BaseEntityBlock { | ||
|
||
public static final BooleanProperty HAS_SUPPORT = BooleanProperty.create("has_support"); | ||
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; | ||
public static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 3, 15); | ||
|
||
public SkilletBlock(Properties pProperties) { | ||
super(pProperties); | ||
this.registerDefaultState(this.defaultBlockState().setValue(FACING, Direction.NORTH).setValue(HAS_SUPPORT, false)); | ||
} | ||
|
||
@Override | ||
protected MapCodec<? extends BaseEntityBlock> codec() { | ||
return null; | ||
} | ||
|
||
public ItemInteractionResult useItemOn(ItemStack pStack, BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand, BlockHitResult pHitResult) { | ||
return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; | ||
} | ||
|
||
@Override | ||
protected InteractionResult useWithoutItem(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, BlockHitResult pHitResult) { | ||
return InteractionResult.PASS; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public BlockEntity newBlockEntity(BlockPos pPos, BlockState pState) { | ||
return new SkilletBlockEntity(pPos, pState); | ||
} | ||
|
||
@Override | ||
protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { | ||
return SHAPE; | ||
} | ||
|
||
@Override | ||
protected @NotNull VoxelShape getCollisionShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { | ||
return pState.getValue(HAS_SUPPORT) ? Shapes.or(SHAPE, Block.box(0, -1, 0, 16, 0, 16)) : pState.getShape(pLevel, pPos); | ||
} | ||
|
||
@Override | ||
protected boolean canSurvive(BlockState pState, LevelReader pLevel, BlockPos pPos) { | ||
return pLevel.getBlockState(pPos.below()).is(CAN_SUPPORT) || canSupportRigidBlock(pLevel, pPos.below()) || canSupportCenter(pLevel, pPos.below(), Direction.UP); | ||
} | ||
|
||
@Override | ||
public BlockState getStateForPlacement(BlockPlaceContext pContext) { | ||
boolean isSupport = pContext.getLevel().getBlockState(pContext.getClickedPos().below()).is(CAN_SUPPORT); | ||
return this.defaultBlockState().setValue(FACING, pContext.getHorizontalDirection()).setValue(HAS_SUPPORT, isSupport); | ||
} | ||
|
||
@Override | ||
public BlockState updateShape(BlockState pState, Direction pFacing, BlockState pFacingState, LevelAccessor pLevel, BlockPos pCurrentPos, BlockPos pFacingPos) { | ||
if (!pState.canSurvive(pLevel, pCurrentPos)) { | ||
return Blocks.AIR.defaultBlockState(); | ||
} | ||
return super.updateShape(pState, pFacing, pFacingState, pLevel, pCurrentPos, pFacingPos); | ||
} | ||
|
||
@Override | ||
public RenderShape getRenderShape(BlockState pState) { | ||
return RenderShape.MODEL; | ||
} | ||
|
||
@Override | ||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> pBuilder) { | ||
pBuilder.add(FACING, HAS_SUPPORT); | ||
} | ||
|
||
} |
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
38 changes: 38 additions & 0 deletions
38
src/main/java/mczme/lingshi/common/block/entity/SkilletBlockEntity.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,38 @@ | ||
package mczme.lingshi.common.block.entity; | ||
|
||
import mczme.lingshi.common.registry.BlockEntityTypes; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.core.HolderLookup; | ||
import net.minecraft.nbt.CompoundTag; | ||
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
|
||
public class SkilletBlockEntity extends BlockEntity { | ||
|
||
|
||
|
||
public SkilletBlockEntity(BlockPos pPos, BlockState pBlockState) { | ||
super(BlockEntityTypes.SKILLET_BLOCKENTITY.get(), pPos, pBlockState); | ||
} | ||
|
||
@Override | ||
public ClientboundBlockEntityDataPacket getUpdatePacket() { | ||
return ClientboundBlockEntityDataPacket.create(this); | ||
} | ||
|
||
@Override | ||
public CompoundTag getUpdateTag(HolderLookup.Provider pRegistries) { | ||
return this.saveCustomOnly(pRegistries); | ||
} | ||
|
||
@Override | ||
protected void loadAdditional(CompoundTag pTag, HolderLookup.Provider pRegistries) { | ||
|
||
} | ||
|
||
@Override | ||
protected void saveAdditional(CompoundTag pTag, HolderLookup.Provider pRegistries) { | ||
super.saveAdditional(pTag, pRegistries); | ||
} | ||
} |
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
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
Oops, something went wrong.