Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev/1.21' into dev/1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuqi154 committed Dec 23, 2024
2 parents 7170ec2 + 88eb4ce commit 4571606
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 733 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ run

# Files from Forge MDK
forge*changelog.txt
/src/generated/resources/.cache/
68 changes: 68 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Camellia License

**Version: 1.0**

---

## Article 1: Definitions
1. This license applies to all individuals or organizations using, modifying, or distributing this project and its derivative works.
2. **"Original Author"** refers to the developer who initially created this project.
3. **"User"** refers to any individual or organization using, modifying, or distributing this project under this license.
4. **"Notify the Original Author"** means the user must send a notice to the publicly available contact provided by the original author:
- The notice must clearly specify the user's planned actions and related details.
- If no objection is received within 7 days after the notice is sent, the user may proceed with their plan.

---

## Article 2: Scope of Authorization
1. Users may freely copy, modify, and distribute this project in non-commercial environments.
2. Commercial use is prohibited without prior authorization, including but not limited to:
- Directly selling this project or its derivative works;
- Authorizing third parties to sell this project or its derivative works;
- Bundling this project or its derivative works as part of paid software or services.
3. To engage in commercial use, the user must contact the original author or an explicitly authorized representative to obtain permission:
- If multiple forks exist, the user should contact the nearest authorized fork developer unless otherwise stated by the original author.

---

## Article 3: Platform Incentives
1. Users may upload this project to platforms (e.g., CurseForge) to earn platform incentives but must **"notify the original author"**.
2. Platform incentives belong entirely to the uploader, and no profit sharing with the original author is required.

---

## Article 4: Code Open-Sourcing and Attribution Requirements
1. Users who modify and distribute this project must meet the following requirements:
- Retain a visible link to the original project in the project code;
- Use the same or a newer version of this license (Camellia License);
- Open-source the modified code on the same code hosting platform as the original author:
- If the user wishes to use additional code hosting platforms, they must **"notify the original author"**.
2. When distributing, users must retain visible attribution to the original author in the project code.

---

## Article 5: Disclaimer
1. This project is provided "as is" without any express or implied warranties, including but not limited to merchantability, fitness for a particular purpose, or non-infringement.
2. The original author is not responsible for any direct or indirect losses resulting from the use or modification of this project.

---

## Article 6: Violation Handling
1. Users who violate this license must immediately cease the violation and take necessary remedial actions.
2. If a user engages in commercial use in violation of this license, the original author has the right to claim all profits gained from the violation.
3. Any disputes are governed by the laws of the jurisdiction where the original author resides.

---

## Article 7: License Revisions
1. Each version of this license is fixed and cannot be altered.
2. Revised versions of this license will be released as new versions, and users may choose to comply with either the current version or any newer version.

---

## Article 8: Other Provisions
1. This license does not restrict users from engaging in other lawful activities permitted by this license.

---

**Copyright © 2024 [Author]**
674 changes: 0 additions & 674 deletions LICENSE.txt

This file was deleted.

4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ loader_version_range=[4,)

mod_id=mystias_izakaya
mod_name=Mystia's Izakaya
mod_license=GPLv3
mod_version=0.1.0-rc5
mod_license=Camellia License
mod_version=0.1.0
mod_group_id=org.hiedacamellia.mystiasizakaya
mod_authors=HiedaCamellia
mod_description=
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
{
"variants": {
"": {
"facing=east": {
"model": "mystias_izakaya:block/telephone",
"y": 90
},
"facing=north": {
"model": "mystias_izakaya:block/telephone"
},
"facing=south": {
"model": "mystias_izakaya:block/telephone",
"y": 180
},
"facing=west": {
"model": "mystias_izakaya:block/telephone",
"y": 270
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

package org.hiedacamellia.mystiasizakaya.content.common.block.blocks;

import io.netty.buffer.Unpooled;
Expand All @@ -16,11 +15,14 @@
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.phys.BlockHitResult;
Expand All @@ -38,68 +40,78 @@
import java.util.List;

public class Telephone extends Block {
public Telephone() {
super(Properties.of().instrument(NoteBlockInstrument.BASEDRUM).sound(SoundType.METAL).strength(1f, 10f).noOcclusion());
}
public Telephone() {
super(Properties.of().instrument(NoteBlockInstrument.BASEDRUM).sound(SoundType.METAL).strength(1f, 10f).noOcclusion());
}

@Override
@OnlyIn(Dist.CLIENT)
public void appendHoverText(ItemStack itemstack, Item.TooltipContext context, List<Component> list, TooltipFlag flag) {
super.appendHoverText(itemstack, context, list, flag);
if (!Screen.hasShiftDown()) {
list.add(Component.literal(
"§7§o" + Component.translatable("tooltip.mystias_izakaya.press_shift").getString() + "§r"));
} else {
String[] description = Component.translatable("tooltip.mystias_izakaya.telephone").getString().split("§n");
for (String line : description) {
list.add(Component.literal(line));
}
}
}

@Override
@OnlyIn(Dist.CLIENT)
public void appendHoverText(ItemStack itemstack, Item.TooltipContext context, List<Component> list, TooltipFlag flag) {
super.appendHoverText(itemstack, context, list, flag);
if (!Screen.hasShiftDown()) {
list.add(Component.literal(
"§7§o" + Component.translatable("tooltip.mystias_izakaya.press_shift").getString() + "§r"));
} else {
String[] description = Component.translatable("tooltip.mystias_izakaya.telephone").getString().split("§n");
for (String line : description) {
list.add(Component.literal(line));
}
}
}
@Override
public int getLightBlock(BlockState state, BlockGetter worldIn, BlockPos pos) {
return 15;
}

@Override
public int getLightBlock(BlockState state, BlockGetter worldIn, BlockPos pos) {
return 15;
}
@Override
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
return Collections.singletonList(new ItemStack(this, 1));
}

@Override
public List<ItemStack> getDrops(BlockState state, LootParams.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
return Collections.singletonList(new ItemStack(this, 1));
}
@Override
public @NotNull InteractionResult useWithoutItem(@NotNull BlockState blockstate, @NotNull Level world, @NotNull BlockPos pos, @NotNull Player entity, @NotNull BlockHitResult hit) {
super.useWithoutItem(blockstate, world, pos, entity, hit);

@Override
public @NotNull InteractionResult useWithoutItem(@NotNull BlockState blockstate, @NotNull Level world, @NotNull BlockPos pos, @NotNull Player entity, @NotNull BlockHitResult hit) {
super.useWithoutItem(blockstate, world, pos, entity, hit);

int tick = entity.getData(MIAttachment.MI_TELE_COLDDOWN).tick();
if (tick > 0) {
entity.sendSystemMessage(Component.translatable("message.mystiasizakaya.telephone.colddown", tick / 20).withStyle(ChatFormatting.RED));
return InteractionResult.FAIL;
}

int tick = entity.getData(MIAttachment.MI_TELE_COLDDOWN).tick();
if(tick>0){
entity.sendSystemMessage(Component.translatable("message.mystiasizakaya.telephone.colddown",tick/20).withStyle(ChatFormatting.RED));
return InteractionResult.FAIL;
}
if (entity instanceof ServerPlayer player) {
player.openMenu(new MenuProvider() {
@Override
public @NotNull Component getDisplayName() {
return Component.literal("Telephone");
}

if (entity instanceof ServerPlayer player) {
player.openMenu(new MenuProvider() {
@Override
public @NotNull Component getDisplayName() {
return Component.literal("Telephone");
}
@Override
public AbstractContainerMenu createMenu(int id, @NotNull Inventory inventory, @NotNull Player player) {
return new TelephoneUiMenu(id, inventory, new FriendlyByteBuf(Unpooled.buffer()).writeBlockPos(pos));
}
}, pos);
}
return InteractionResult.SUCCESS;
}

@Override
public AbstractContainerMenu createMenu(int id, @NotNull Inventory inventory, @NotNull Player player) {
return new TelephoneUiMenu(id, inventory, new FriendlyByteBuf(Unpooled.buffer()).writeBlockPos(pos));
}
}, pos);
}
return InteractionResult.SUCCESS;
}
@Override
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
return Shapes.join(box(4, 0, 4, 12, 4, 12), box(0, 0, 0, 0, 0, 0), BooleanOp.ONLY_FIRST);
}

@Override
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
return Shapes.join(box(4, 0, 4, 12, 4, 12), box(0,0,0,0,0,0), BooleanOp.ONLY_FIRST);
}
@Override
public BlockState getStateForPlacement(BlockPlaceContext pContext) {
return defaultBlockState()
.setValue(HorizontalDirectionalBlock.FACING, pContext.getHorizontalDirection().getOpposite());
}

@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> pBuilder) {
pBuilder.add(HorizontalDirectionalBlock.FACING);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected void registerStatesAndModels() {
simpleBlock(MIBlock.STEAMER.get(),models().getExistingFile(modLoc("block/steamer")));
simpleBlock(MIBlock.FRYING_PAN.get(),models().getExistingFile(modLoc("block/frying_pan")));

simpleBlockWithItem(MIBlock.TELEPHONE.get(),models().getExistingFile(modLoc("block/telephone")));
horizontalBlock(MIBlock.TELEPHONE.get(),models().getExistingFile(modLoc("block/telephone")));
simpleBlockWithItem(MIBlock.TABLE.get(),models().getExistingFile(modLoc("block/table")));
}
}

0 comments on commit 4571606

Please sign in to comment.