├── .github └── workflows │ └── build.yml ├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src └── main ├── java └── net │ └── mafuyu33 │ └── mafishmod │ ├── DelayedOperation.java │ ├── ForTest.txt │ ├── ServerManager.java │ ├── TutorialMod.java │ ├── TutorialModClient.java │ ├── TutorialModDataGenerator.java │ ├── VRPlugin.java │ ├── block │ ├── ModBlocks.java │ ├── custom │ │ ├── GemPolishingStationBlock.java │ │ ├── PotatoTNTBlock.java │ │ ├── PotatoTNTPrepareBlock.java │ │ └── SoundBlock.java │ └── entity │ │ ├── GemPolishingStationBlockEntity.java │ │ ├── ImplementedInventory.java │ │ └── ModBlockEntities.java │ ├── config │ ├── CommonConstants.java │ ├── ConfigHelper.java │ ├── ModConfig.java │ └── ModMenuIntegration.java │ ├── datagen │ ├── ModBlockTagProvider.java │ ├── ModLootTableProvider.java │ ├── ModModelProvider.java │ ├── ModPoiTagProvider.java │ ├── ModRecipeProvider.java │ └── ModitemTagProvider.java │ ├── effect │ ├── ModStatusEffects.java │ └── custom │ │ └── NormalEffect.java │ ├── enchantment │ ├── CursedLv1.java │ ├── CursedLv3.java │ ├── CursedLv5.java │ ├── CursedTreasureLv1.java │ ├── ModEnchantments.java │ ├── NormalLv1.java │ ├── NormalLv5.java │ └── TreasureLv1.java │ ├── enchantmentblock │ ├── BlockEnchantmentStorage.java │ └── BlockStateSaverAndLoader.java │ ├── entity │ ├── CustomLlamaSpitEntity.java │ ├── DiamondProjectileEntity.java │ ├── FireworkArrowEntity.java │ ├── FuProjectileEntity.java │ ├── LightningProjectileEntity.java │ ├── ModEntities.java │ ├── StoneBallProjectileEntity.java │ └── TNTProjectileEntity.java │ ├── event │ ├── AfterBlockBreakHandler.java │ ├── AttackBlockHandler.java │ ├── AttackEntityHandler.java │ ├── AttackKeyCheckHandler.java │ ├── BeforeBlockBreakHandler.java │ ├── ChatMessageHandler.java │ ├── ChunkLoadListener.java │ ├── ExplosionHandler.java │ ├── KeyInputHandler.java │ ├── UseBlockHandler.java │ └── UseEntityHandler.java │ ├── item │ ├── ModArmorMaterials.java │ ├── ModFoodComponents.java │ ├── ModItemGroups.java │ ├── ModItems.java │ ├── ModToolMaterial.java │ ├── custom │ │ ├── AppleVisionProItem.java │ │ ├── BreadSwordHotItem.java │ │ ├── BreadSwordItem.java │ │ ├── BreadSwordVeryHotItem.java │ │ ├── CheeseBergerItem.java │ │ ├── ColliableItem.java │ │ ├── FireworkArrowItem.java │ │ ├── FuItem.java │ │ ├── LightningBallItem.java │ │ ├── LightningItem.java │ │ ├── LlamaItem.java │ │ ├── MathSwordItem.java │ │ ├── MetalDetectorItem.java │ │ ├── MilkFleshItem.java │ │ ├── ModArmorItem.java │ │ ├── ModStatusEffects.java │ │ ├── PoisonSwordItem.java │ │ ├── RTX4090Item.java │ │ ├── RubyStuffItem.java │ │ ├── StargazyPieItem.java │ │ ├── StoneBallItem.java │ │ ├── SwitchItem.java │ │ ├── TNTBallItem.java │ │ ├── TimeStopItem.java │ │ ├── VillagerItem.java │ │ └── ZhuGeItem.java │ └── vrcustom │ │ ├── CatchyouItem.java │ │ ├── VrCompassesItem.java │ │ ├── VrGettingOverItItem.java │ │ ├── VrMagicItem.java │ │ ├── VrPenItem.java │ │ ├── VrRubberItem.java │ │ └── VrRulerItem.java │ ├── mixin │ ├── ExampleMixin.java │ ├── ParticleManagerMixin.java │ ├── effectmixin │ │ ├── TeleportEffectMixin.java │ │ ├── antidote │ │ │ └── LivingEntityMixin.java │ │ ├── canclimb │ │ │ ├── LivingEntityMixin.java │ │ │ └── MobEntityMixin.java │ │ └── sheep │ │ │ ├── LimbAnimatorAccessor.java │ │ │ ├── LivingEntityMixin.java │ │ │ ├── PlayerEntityMixin.java │ │ │ └── PlayerEntityRendererMixin.java │ ├── enchantmentblockmixin │ │ ├── custom │ │ │ ├── badluckofsea │ │ │ │ ├── FallingBlockEntityMixin.java │ │ │ │ └── FlowableFluidMixin.java │ │ │ ├── bellknockbackandhurt │ │ │ │ └── BellBlockEntityMixin.java │ │ │ ├── bellresonance │ │ │ │ └── BellBlockEntityMixin.java │ │ │ ├── blastprotection │ │ │ │ └── ExplosionBehaviorMixin.java │ │ │ ├── buttonrandom │ │ │ │ └── PlayerEntityMixin.java │ │ │ ├── fallprotection │ │ │ │ └── BlockMixin.java │ │ │ ├── fasthopper │ │ │ │ └── HopperBlockEntityMixin.java │ │ │ ├── furnace │ │ │ │ └── AbstractFurnaceBlockEntityMixin.java │ │ │ ├── knockback │ │ │ │ ├── AbstractBlockMixin.java │ │ │ │ ├── AbstractPressurePlateBlockMixin.java │ │ │ │ ├── BlockMixin.java │ │ │ │ ├── ButtonBlockMixin.java │ │ │ │ ├── LivingEntityMixin.java │ │ │ │ ├── NetherPortalBlockMixin.java │ │ │ │ └── TripwireBlockMixin.java │ │ │ ├── punchtrapdoor │ │ │ │ └── TrapdoorBlockMixin.java │ │ │ ├── respiration │ │ │ │ └── FlowableFluidMixin.java │ │ │ ├── targetblock │ │ │ │ └── TargetBlockMixin.java │ │ │ ├── thorns │ │ │ │ ├── AbstractBlockMixin.java │ │ │ │ └── BlockMixin.java │ │ │ ├── tnt │ │ │ │ └── TntBlockMixin.java │ │ │ └── waterbroken │ │ │ │ └── FlowableFluidMixin.java │ │ └── main │ │ │ ├── BlockMixin.java │ │ │ ├── BrushItemMixin.java │ │ │ ├── PistonBlockMixin.java │ │ │ ├── PlayerEntityMixin.java │ │ │ ├── WorldMixin.java │ │ │ └── sigleinject │ │ │ ├── AbstractBannerBlockMixin.java │ │ │ ├── AbstractFurnaceBlockMixin.java │ │ │ ├── AbstractRedStoneGateBlockMixin.java │ │ │ ├── BarrelBlockMixin.java │ │ │ ├── BeaconMixin.java │ │ │ ├── BrewingStandBlockMixin.java │ │ │ ├── ChestBlockMixin.java │ │ │ ├── CobwebBlockMixin.java │ │ │ ├── CommandBlockMixin.java │ │ │ ├── ConduitBlockMixin.java │ │ │ ├── CrafterBlockMixin.java │ │ │ ├── DecoratedPotMixin.java │ │ │ ├── DispenserBlockMixin.java │ │ │ ├── DoorBlockMixin.java │ │ │ ├── EnchantingTableBlockMixin.java │ │ │ ├── HopperBlockMixin.java │ │ │ ├── PistonBlockMixin.java │ │ │ ├── PitcherCropBlockMixin.java │ │ │ ├── ShulkerBoxBlockMixin.java │ │ │ ├── SmallDripleafBlockMixin.java │ │ │ ├── StructureBlockMixin.java │ │ │ ├── TallPlantBlockMixin.java │ │ │ └── TripwireHookBlockMixin.java │ ├── enchantmentitemmixin │ │ ├── AlwaysEnchantableMixin.java │ │ ├── ArmorEnchantmentMixin.java │ │ ├── BadLuckOfSeaItemEntityMixin.java │ │ ├── GongXiFaCaiMixin.java │ │ ├── HorseSaddleEnchantmentMixin.java │ │ ├── InfiniteBucketMixin.java │ │ ├── InfiniteFoodMixin.java │ │ ├── InfinitePickaxeItemMixin.java │ │ ├── InfiniteUndyingMixin.java │ │ ├── ReverseMixin.java │ │ ├── WeaponEnchantmentMixin.java │ │ ├── bowleft │ │ │ ├── AbstractSkeletonEntityMixin.java │ │ │ └── BowItemMixin.java │ │ ├── bowloyalty │ │ │ ├── BowItemMixin.java │ │ │ └── PersistentProjectileEntityMixin.java │ │ ├── elytra │ │ │ └── PlayerEntityMixin.java │ │ ├── enderpearl │ │ │ ├── EnderPearlEntityMixin.java │ │ │ └── EnderPearlItemMixin.java │ │ ├── fangsheng │ │ │ └── ItemEntityMixin.java │ │ ├── fishingrod │ │ │ ├── FishingBobberEntityMixin.java │ │ │ └── FishingRodItemMixin.java │ │ ├── luoyangshovel │ │ │ ├── FallingBlockEntityMixin.java │ │ │ └── ShovelItemMixin.java │ │ ├── multishot_trident │ │ │ └── TridentItemMixin.java │ │ ├── slimefeet │ │ │ └── BlockMixin.java │ │ ├── slippery │ │ │ ├── HandledScreenMixin.java │ │ │ ├── InventoryScreenMixin.java │ │ │ └── UnPickUpAbleItemMixin.java │ │ └── throwableaxe │ │ │ ├── AxeItemMixin.java │ │ │ └── ItemEntityMixin.java │ ├── itemmixin │ │ ├── BowDashMixin.java │ │ ├── KaoFishMixin.java │ │ ├── MathModeMixin.java │ │ ├── NestedBoxMixin.java │ │ ├── ShieldDashMixin.java │ │ ├── ThrowableDiamondMixin.java │ │ ├── cheesebergerforcat │ │ │ └── CatEntityMixin.java │ │ ├── colliableitem │ │ │ ├── AbstractBlockMixin.java │ │ │ └── EntityMixin.java │ │ ├── entityitemrenderer │ │ │ ├── irongolemitemrenderer │ │ │ │ └── ItemRendererMixin.java │ │ │ ├── lightningitemrenderer │ │ │ │ └── ItemRendererMixin.java │ │ │ ├── llamaitemrenderer │ │ │ │ └── ItemRendererMixin.java │ │ │ └── villageritemrenderer │ │ │ │ └── ItemRendererMixin.java │ │ ├── fireworkrocket │ │ │ ├── FireworkRocketEntityMixin.java │ │ │ ├── FireworkRocketHitOnEntityMixin.java │ │ │ └── FireworkRocketItemMixin.java │ │ ├── lead │ │ │ ├── LeadItemMixin.java │ │ │ ├── LeadItemMovementMixin.java │ │ │ └── MobEntityMixin.java │ │ ├── lightningrod │ │ │ └── LightningRodMixin.java │ │ ├── rubystuffrenderer │ │ │ ├── ItemRendererAccessor.java │ │ │ ├── ItemRendererMixin.java │ │ │ └── ModelLoaderMixin.java │ │ ├── spyglass │ │ │ └── SpyglassMixin.java │ │ └── swimmingtripwire │ │ │ ├── PlayerEntityMixin.java │ │ │ └── TripwireBlockMixin.java │ ├── mobmixin │ │ ├── BeeRideableMixin.java │ │ ├── goatdashforever │ │ │ └── GoatBrainMixin.java │ │ ├── llamaspitforever │ │ │ ├── LlamaEntityMixin.java │ │ │ └── LlamaEntity_SpitRevengeGoalMixin.java │ │ └── pandaeatswitch │ │ │ └── PandaEntityMixin.java │ └── worldtick │ │ └── ServerTickMixin.java │ ├── mixinhelper │ ├── BellBlockDelayMixinHelper.java │ ├── BowDashMixinHelper.java │ ├── ElytraJumpMixinHelper.java │ ├── FearMixinHelper.java │ ├── FireworkRocketEntityMixinHelper.java │ ├── InjectHelper.java │ ├── MathQuestionMixinHelper.java │ ├── MixinHelperManager.java │ ├── ShieldDashMixinHelper.java │ ├── TripwireBlockMixinHelper.java │ ├── VrRubberItemHelper.java │ └── WeaponEnchantmentMixinHelper.java │ ├── networking │ ├── ModMessages.java │ └── packet │ │ ├── C2S │ │ ├── BowDashC2SPacket.java │ │ ├── ExampleC2SPacket.java │ │ ├── FuC2SPacket.java │ │ ├── GameOptionsC2SPacket.java │ │ ├── ParticleColorC2SPacket.java │ │ ├── ParticleDataC2SPacket.java │ │ ├── SheepBreedingC2SPacket.java │ │ ├── ShieldDashC2SPacket.java │ │ └── ThrowPowerC2SPacket.java │ │ └── S2C │ │ ├── BellSoundS2CPacket.java │ │ ├── ExampleS2CPacket.java │ │ └── NeverGonnaS2CPacket.java │ ├── particle │ ├── ModParticles.java │ ├── ParticleStorage.java │ ├── StateSaverAndLoader.java │ └── custom │ │ ├── CitrineParticle.java │ │ ├── KnockBackParticle.java │ │ └── RubberParticle.java │ ├── potion │ └── ModPotions.java │ ├── render │ ├── ALeaf.java │ ├── CustomParticleRenderer.java │ └── ZhugePosing.java │ ├── screen │ ├── GemPolishingScreen.java │ ├── GemPolishingScreenHandler.java │ └── ModScreenHandlers.java │ ├── sound │ └── ModSounds.java │ ├── util │ ├── EvictingLinkedHashSetQueue.java │ ├── ModCustomTrades.java │ ├── ModLootTableModifiers.java │ ├── ModModelPredicateProvider.java │ ├── ModTags.java │ ├── VRDataHandler.java │ └── WallAttackGoal.java │ └── villager │ └── ModVillagers.java └── resources ├── assets └── mafishmod │ ├── blockstates │ ├── gem_polishing_station.json │ ├── gold_melon.json │ ├── potato_tnt.json │ ├── potato_tnt_prepare.json │ ├── raw_ruby_block.json │ ├── ruby_block.json │ └── white_cat_block.json │ ├── icon.png │ ├── lang │ ├── en_us.json │ └── zh_cn.json │ ├── models │ ├── block │ │ ├── gem_polishing_station.json │ │ ├── gold_melon.json │ │ ├── potato_tnt.json │ │ ├── potato_tnt_prepare.json │ │ ├── raw_ruby_block.json │ │ ├── ruby_block.json │ │ └── white_cat_block.json │ └── item │ │ ├── apple_vision_pro.json │ │ ├── bread_sword.json │ │ ├── bread_sword_hot.json │ │ ├── bread_sword_very_hot.json │ │ ├── cheese_berger.json │ │ ├── coal_briquette.json │ │ ├── colliable.json │ │ ├── cool_glass.json │ │ ├── cool_glass2.json │ │ ├── firework_arrow.json │ │ ├── fu.json │ │ ├── gem_polishing_station.json │ │ ├── gold_melon.json │ │ ├── iron_fake.json │ │ ├── iron_golem_item.json │ │ ├── lightning_ball.json │ │ ├── math_sword.json │ │ ├── metal_detector.json │ │ ├── milk_flesh.json │ │ ├── poison_sword.json │ │ ├── potato_tnt.json │ │ ├── potato_tnt_prepare.json │ │ ├── raw_ruby.json │ │ ├── raw_ruby_block.json │ │ ├── rtx4090.json │ │ ├── rtx4090pickaxe.json │ │ ├── ruby.json │ │ ├── ruby_block.json │ │ ├── ruby_staff.json │ │ ├── ruby_staff_3d.json │ │ ├── stargazy_pie.json │ │ ├── stone_ball.json │ │ ├── switch.json │ │ ├── time_stop.json │ │ ├── tnt_ball.json │ │ ├── tomato.json │ │ ├── villager_item.json │ │ ├── vr_compasses.json │ │ ├── vr_magic.json │ │ ├── vr_pen.json │ │ ├── vr_rubber.json │ │ ├── vr_ruler.json │ │ ├── white_cat_block.json │ │ ├── zhuge.json │ │ ├── zhuge_arrow.json │ │ ├── zhuge_firework.json │ │ ├── zhuge_pulling_0.json │ │ ├── zhuge_pulling_1.json │ │ └── zhuge_pulling_2.json │ ├── particles │ ├── citrine_particle.json │ └── rubber_particle.json │ ├── sounds.json │ ├── sounds │ ├── cheese_berger_cat.ogg │ ├── cheese_berger_man.ogg │ ├── dash_sound.ogg │ ├── metal_detector_found_ore.ogg │ ├── never1.ogg │ ├── never10.ogg │ ├── never2.ogg │ ├── never3.ogg │ ├── never4.ogg │ ├── never5.ogg │ ├── never6.ogg │ ├── never7.ogg │ ├── never8.ogg │ ├── never9.ogg │ ├── pin.ogg │ ├── sound_block_break.ogg │ ├── sound_block_fall.ogg │ ├── sound_block_hit.ogg │ ├── sound_block_place.ogg │ └── sound_block_step.ogg │ └── textures │ ├── block │ ├── gem_polishing_station_texture.png │ ├── gold_melon_side.png │ ├── gold_melon_top.png │ ├── potato_tnt.png │ ├── potato_tnt_prepare.png │ ├── raw_ruby_block.png │ ├── ruby_block.png │ └── white_cat_block.png │ ├── entity │ └── villager │ │ └── profession │ │ └── sound_master.png │ ├── gui │ ├── a_leaf.png │ └── gem_polishing_station_gui.png │ ├── item │ ├── apple_vision_pro.png │ ├── bread_sword.png │ ├── bread_sword_hot.png │ ├── bread_sword_very_hot.png │ ├── cheese_berger.png │ ├── coal_briquette.png │ ├── colliable.png │ ├── cool_glass.png │ ├── cool_glass2.png │ ├── firework_arrow.png │ ├── fu.png │ ├── iron_fake.png │ ├── iron_golem_item.png │ ├── lightning_ball.png │ ├── math_sword.png │ ├── metal_detector.png │ ├── milk_flesh.png │ ├── poison_sword.png │ ├── potato_tnt.png │ ├── raw_ruby.png │ ├── rtx4090.png │ ├── ruby.png │ ├── ruby_boots.png │ ├── ruby_chestplate.png │ ├── ruby_helmet.png │ ├── ruby_leggings.png │ ├── ruby_pickaxe.png │ ├── ruby_staff.png │ ├── ruby_staff_3d.png │ ├── stargazy_pie.png │ ├── stone_ball.png │ ├── switch.png │ ├── time_stop.png │ ├── tnt_ball.png │ ├── tomato.png │ ├── villager_item.png │ ├── vr_compasses.png │ ├── vr_magic.png │ ├── vr_pen.png │ ├── vr_rubber.png │ ├── vr_ruler.png │ ├── zhuge_arrow.png │ ├── zhuge_firework.png │ ├── zhuge_pulling_0.png │ ├── zhuge_pulling_1.png │ ├── zhuge_pulling_2.png │ └── zhuge_standby.png │ ├── mob_effect │ ├── antidote_effect.png │ ├── flower_effect.png │ ├── ironman.png │ ├── sheep_effect.png │ ├── spider_effect.png │ └── teleport_effect.png │ ├── models │ └── armor │ │ ├── ruby_layer_1.png │ │ └── ruby_layer_2.png │ └── particle │ ├── citrine.png │ └── rubber.png ├── data ├── fabric │ └── tags │ │ └── blocks │ │ └── needs_tool_level_4.json ├── minecraft │ └── tags │ │ ├── blocks │ │ ├── mineable │ │ │ ├── axes.json │ │ │ ├── hoe.json │ │ │ ├── pickaxe.json │ │ │ └── shovel.json │ │ ├── needs_diamond_tool.json │ │ ├── needs_iron_tool.json │ │ └── needs_stone_tool.json │ │ └── items │ │ └── arrows.json └── tutorialmod │ ├── loot_tables │ └── blocks │ │ ├── gold_melon.json │ │ ├── raw_ruby_block.json │ │ ├── ruby_block.json │ │ └── white_cat_block.json │ ├── recipes │ ├── apple_vision_pro.json │ ├── bread_sword.json │ ├── bread_sword_hot.json │ ├── bread_sword_very_hot.json │ ├── cheese_berger.json │ ├── fire_fish_and_chips.json │ ├── firework_arrow.json │ ├── fu.json │ ├── lightning_ball.json │ ├── milk_flesh.json │ ├── poison_sword.json │ ├── potato_tnt.json │ ├── ruby_block_from_ruby.json │ ├── ruby_pickaxe_from_ruby.json │ ├── ruby_ruby_from_block.json │ ├── ruby_stuff.json │ ├── stargazy_pie.json │ ├── stone_ball.json │ └── tnt_ball.json │ └── tags │ ├── blocks │ └── metal_detector_detectable_blocks.json │ └── items │ └── mod_arrow_items.json ├── fabric.mod.json ├── mafishmod.accesswidener └── mafishmod.mixins.json /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # Automatically build the project and run any configured tests for every push 2 | # and submitted pull request. This can help catch issues that only occur on 3 | # certain platforms or Java versions, and provides a first line of defence 4 | # against bad commits. 5 | 6 | name: build 7 | on: [pull_request, push] 8 | 9 | jobs: 10 | build: 11 | strategy: 12 | matrix: 13 | # Use these Java versions 14 | java: [ 15 | 17, # Current Java LTS & minimum supported by Minecraft 16 | 21, # Current Java LTS 17 | ] 18 | # and run on both Linux and Windows 19 | os: [ubuntu-22.04, windows-2022] 20 | runs-on: ${{ matrix.os }} 21 | steps: 22 | - name: checkout repository 23 | uses: actions/checkout@v4 24 | - name: validate gradle wrapper 25 | uses: gradle/wrapper-validation-action@v1 26 | - name: setup jdk ${{ matrix.java }} 27 | uses: actions/setup-java@v4 28 | with: 29 | java-version: ${{ matrix.java }} 30 | distribution: 'microsoft' 31 | - name: make gradle wrapper executable 32 | if: ${{ runner.os != 'Windows' }} 33 | run: chmod +x ./gradlew 34 | - name: build 35 | run: ./gradlew build 36 | - name: capture build artifacts 37 | if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS 38 | uses: actions/upload-artifact@v3 39 | with: 40 | name: Artifacts 41 | path: build/libs/ -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # gradle 2 | 3 | .gradle/ 4 | build/ 5 | out/ 6 | classes/ 7 | 8 | # eclipse 9 | 10 | *.launch 11 | 12 | # idea 13 | 14 | .idea/ 15 | *.iml 16 | *.ipr 17 | *.iws 18 | 19 | # vscode 20 | 21 | .settings/ 22 | .vscode/ 23 | bin/ 24 | .classpath 25 | .project 26 | 27 | # macos 28 | 29 | *.DS_Store 30 | 31 | # fabric 32 | 33 | run/ 34 | 35 | # java 36 | 37 | hs_err_*.log 38 | replay_*.log 39 | *.hprof 40 | *.jfr 41 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx1G 3 | org.gradle.parallel=true 4 | 5 | # Fabric Properties 6 | # check these on https://fabricmc.net/develop 7 | minecraft_version=1.20.4 8 | yarn_mappings=1.20.4+build.3 9 | loader_version=0.15.6 10 | 11 | # Mod Properties 12 | mod_version=0.24-1.20.4 13 | maven_group=net.mafuyu33.mafishmod 14 | archives_base_name=mafishmod 15 | 16 | # Dependencies 17 | fabric_version=0.96.1+1.20.4 -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | mavenCentral() 8 | gradlePluginPortal() 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/DelayedOperation.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod; 2 | 3 | import java.util.Timer; 4 | import java.util.TimerTask; 5 | 6 | public class DelayedOperation { 7 | private Timer timer; 8 | 9 | public DelayedOperation() { 10 | timer = new Timer(); 11 | } 12 | 13 | public void startDelayedOperation() { 14 | timer.schedule(new TimerTask() { 15 | @Override 16 | public void run() { 17 | // 执行你想要延迟执行的操作 18 | System.out.println("Delayed operation executed."); 19 | // 重置计时器 20 | restartTimer(); 21 | } 22 | }, 5000); // 延迟5秒执行,单位为毫秒 23 | } 24 | 25 | private void restartTimer() { 26 | // 取消当前任务 27 | timer.cancel(); 28 | // 创建一个新的Timer对象,用于重置计时器 29 | timer = new Timer(); 30 | // 重新启动延迟操作 31 | startDelayedOperation(); 32 | } 33 | 34 | public static void main(String[] args) { 35 | DelayedOperation delayedOperation = new DelayedOperation(); 36 | delayedOperation.startDelayedOperation(); 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/ServerManager.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod; 2 | 3 | import net.minecraft.server.MinecraftServer; 4 | 5 | public class ServerManager { 6 | private static MinecraftServer serverInstance; 7 | 8 | public static void setServerInstance(MinecraftServer server) { 9 | serverInstance = server; 10 | } 11 | 12 | public static MinecraftServer getServerInstance() { 13 | return serverInstance; 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/TutorialModDataGenerator.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod; 2 | 3 | import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; 4 | import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; 5 | import net.mafuyu33.mafishmod.datagen.*; 6 | 7 | public class TutorialModDataGenerator implements DataGeneratorEntrypoint { 8 | @Override 9 | public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { 10 | FabricDataGenerator.Pack pack=fabricDataGenerator.createPack(); 11 | 12 | pack.addProvider(ModBlockTagProvider::new); 13 | pack.addProvider(ModitemTagProvider::new); 14 | pack.addProvider(ModLootTableProvider::new); 15 | pack.addProvider(ModModelProvider::new); 16 | pack.addProvider(ModRecipeProvider::new); 17 | pack.addProvider(ModPoiTagProvider::new); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/block/custom/PotatoTNTBlock.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.block.custom; 2 | 3 | 4 | import net.mafuyu33.mafishmod.entity.TNTProjectileEntity; 5 | import net.mafuyu33.mafishmod.item.ModItems; 6 | import net.minecraft.block.BlockState; 7 | import net.minecraft.block.SlabBlock; 8 | import net.minecraft.entity.Entity; 9 | import net.minecraft.entity.LivingEntity; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.world.World; 12 | import net.minecraft.world.explosion.Explosion; 13 | 14 | 15 | public class PotatoTNTBlock extends SlabBlock { 16 | public PotatoTNTBlock(Settings settings) { 17 | super(settings); 18 | } 19 | 20 | @Override 21 | public void onSteppedOn(World world, BlockPos pos, BlockState state, Entity entity) { 22 | super.onSteppedOn(world, pos, state, entity); 23 | if(entity instanceof LivingEntity) { 24 | TNTProjectileEntity tntProjectileEntity = new TNTProjectileEntity(((LivingEntity) entity), world); 25 | tntProjectileEntity.setItem(ModItems.TNT_BALL.getDefaultStack()); 26 | tntProjectileEntity.setVelocity(entity,90,entity.getYaw(), 0.0f, 5f, 0f); 27 | world.spawnEntity(tntProjectileEntity); 28 | } 29 | } 30 | 31 | @Override 32 | public void onDestroyedByExplosion(World world, BlockPos pos, Explosion explosion) { 33 | super.onDestroyedByExplosion(world, pos, explosion); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/block/custom/PotatoTNTPrepareBlock.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.block.custom; 2 | 3 | import net.mafuyu33.mafishmod.block.ModBlocks; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.FlowerBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.entity.effect.StatusEffect; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | import org.jetbrains.annotations.Nullable; 12 | 13 | import java.util.Timer; 14 | import java.util.TimerTask; 15 | 16 | public class PotatoTNTPrepareBlock extends FlowerBlock { 17 | 18 | public PotatoTNTPrepareBlock(StatusEffect suspiciousStewEffect, int effectDuration, Settings settings) { 19 | super(suspiciousStewEffect, effectDuration, settings); 20 | } 21 | 22 | @Override 23 | public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) { 24 | super.onPlaced(world, pos, state, placer, itemStack); 25 | startDelayedOperation(world,pos,state,placer,itemStack); 26 | } 27 | 28 | private void startDelayedOperation(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) { 29 | Timer timer = new Timer(); // 创建一个新的计时器 30 | timer.schedule(new TimerTask() { 31 | @Override 32 | public void run() { 33 | world.breakBlock(pos,false); 34 | world.setBlockState(pos, (ModBlocks.POTATO_TNT.getDefaultState()), 3); 35 | } 36 | }, 5000); // 延迟5秒执行,单位为毫秒 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/block/custom/SoundBlock.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.block.custom; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.entity.player.PlayerEntity; 6 | import net.minecraft.sound.SoundCategory; 7 | import net.minecraft.sound.SoundEvents; 8 | import net.minecraft.util.ActionResult; 9 | import net.minecraft.util.Hand; 10 | import net.minecraft.util.hit.BlockHitResult; 11 | import net.minecraft.util.math.BlockPos; 12 | import net.minecraft.world.World; 13 | 14 | public class SoundBlock extends Block { 15 | public SoundBlock(Settings settings) { 16 | super(settings); 17 | } 18 | 19 | @Override 20 | public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { 21 | world.playSound(player,pos, SoundEvents.BLOCK_NOTE_BLOCK_XYLOPHONE.value(), SoundCategory.BLOCKS,1f,1f); 22 | return ActionResult.SUCCESS; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/block/entity/ModBlockEntities.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.block.entity; 2 | 3 | import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; 4 | 5 | import net.mafuyu33.mafishmod.TutorialMod; 6 | import net.mafuyu33.mafishmod.block.ModBlocks; 7 | import net.minecraft.block.entity.BlockEntityType; 8 | import net.minecraft.registry.Registries; 9 | import net.minecraft.registry.Registry; 10 | import net.minecraft.util.Identifier; 11 | 12 | public class ModBlockEntities { 13 | public static final BlockEntityType GEM_POLISHING_STATION_BLOCK_ENTITY = 14 | Registry.register(Registries.BLOCK_ENTITY_TYPE, new Identifier(TutorialMod.MOD_ID, "gem_polishing_be"), 15 | FabricBlockEntityTypeBuilder.create(GemPolishingStationBlockEntity::new, 16 | ModBlocks.GEM_POLISHING_STATION).build()); 17 | 18 | public static void registerBlockEntities() { 19 | TutorialMod.LOGGER.info("Registering Block Entities for " + TutorialMod.MOD_ID); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/config/CommonConstants.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.config; 2 | 3 | public class CommonConstants { 4 | 5 | public static final int distanceToRemoveImmersive = 12; // Distance to stop tracking immersives from 6 | public static final int distanceSquaredToRemoveImmersive = distanceToRemoveImmersive * distanceToRemoveImmersive; 7 | 8 | public static final int[] minimumVRAPIVersion = new int[]{3, 0, 3}; 9 | 10 | // Vibration values 11 | public static final float vibrationTimePlayerActionAlert = 0.05f; // Such as opening the bag from reach behind 12 | public static final float vibrationTimeWorldInteraction = 0.15f; // Such as opening/closing a door 13 | 14 | public static final float vibrationTimeRangedGrab = vibrationTimePlayerActionAlert / 2f; 15 | 16 | public static String vrAPIVersionAsString() { 17 | return minimumVRAPIVersion[0] + "." + minimumVRAPIVersion[1] + "." + minimumVRAPIVersion[2]; 18 | } 19 | 20 | public static String firstNonCompatibleFutureVersionAsString() { 21 | return (minimumVRAPIVersion[0] + 1) + ".0.0"; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/config/ModMenuIntegration.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.config; 2 | 3 | import com.terraformersmc.modmenu.api.ConfigScreenFactory; 4 | import com.terraformersmc.modmenu.api.ModMenuApi; 5 | import me.shedaniel.autoconfig.AutoConfig; 6 | 7 | public class ModMenuIntegration implements ModMenuApi { 8 | 9 | @Override 10 | public ConfigScreenFactory getModConfigScreenFactory() { 11 | return parent -> AutoConfig.getConfigScreen(ModConfig.class, parent).get(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/datagen/ModLootTableProvider.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.datagen; 2 | 3 | import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; 4 | import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider; 5 | import net.minecraft.block.Block; 6 | import net.minecraft.data.server.loottable.BlockLootTableGenerator; 7 | import net.minecraft.enchantment.Enchantments; 8 | import net.minecraft.item.Item; 9 | import net.minecraft.item.Items; 10 | import net.minecraft.loot.LootTable; 11 | import net.minecraft.loot.entry.ItemEntry; 12 | import net.minecraft.loot.entry.LeafEntry; 13 | import net.minecraft.loot.entry.LootPoolEntry; 14 | import net.minecraft.loot.function.ApplyBonusLootFunction; 15 | import net.minecraft.loot.function.SetCountLootFunction; 16 | import net.minecraft.loot.provider.number.UniformLootNumberProvider; 17 | 18 | public class ModLootTableProvider extends FabricBlockLootTableProvider { 19 | public ModLootTableProvider(FabricDataOutput dataOutput) { 20 | super(dataOutput); 21 | } 22 | 23 | @Override 24 | public void generate() { 25 | // addDrop(ModBlocks.RUBY_BLOCK); 26 | // addDrop(ModBlocks.WHATE_CAT_BLOCK); 27 | // 28 | // addDrop(ModBlocks.RAW_RUBY_BLOCK,copperLikeDrops(ModBlocks.RAW_RUBY_BLOCK, ModItems.RAW_RUBY)); 29 | } 30 | public LootTable.Builder copperLikeDrops(Block drop, Item item) { 31 | return BlockLootTableGenerator.dropsWithSilkTouch(drop, (LootPoolEntry.Builder)this.applyExplosionDecay(drop, ((LeafEntry.Builder)ItemEntry.builder(Items.RAW_COPPER).apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(2.0f, 5.0f)))).apply(ApplyBonusLootFunction.oreDrops(Enchantments.FORTUNE)))); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/datagen/ModPoiTagProvider.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.datagen; 2 | 3 | import net.mafuyu33.mafishmod.TutorialMod; 4 | import net.minecraft.data.DataOutput; 5 | import net.minecraft.data.server.tag.TagProvider; 6 | import net.minecraft.registry.RegistryKeys; 7 | import net.minecraft.registry.RegistryWrapper; 8 | import net.minecraft.registry.tag.PointOfInterestTypeTags; 9 | import net.minecraft.util.Identifier; 10 | import net.minecraft.world.poi.PointOfInterestType; 11 | 12 | import java.util.concurrent.CompletableFuture; 13 | 14 | public class ModPoiTagProvider extends TagProvider { 15 | public ModPoiTagProvider(DataOutput output, 16 | CompletableFuture registryLookupFuture) { 17 | super(output, RegistryKeys.POINT_OF_INTEREST_TYPE, registryLookupFuture); 18 | } 19 | 20 | @Override 21 | protected void configure(RegistryWrapper.WrapperLookup lookup) { 22 | this.getOrCreateTagBuilder(PointOfInterestTypeTags.ACQUIRABLE_JOB_SITE) 23 | .addOptional(new Identifier(TutorialMod.MOD_ID, "soundpoi")); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/datagen/ModRecipeProvider.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.datagen; 2 | 3 | import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; 4 | import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; 5 | import net.minecraft.data.server.recipe.RecipeExporter; 6 | 7 | 8 | public class ModRecipeProvider extends FabricRecipeProvider { 9 | // private static final List RUBY_SMELTABLES = List.of(ModItems.RAW_RUBY, 10 | // ModBlocks.RUBY_BLOCK,ModBlocks.RAW_RUBY_BLOCK); 11 | public ModRecipeProvider(FabricDataOutput output) { 12 | super(output); 13 | } 14 | 15 | @Override 16 | public void generate(RecipeExporter exporter) { 17 | // offerSmelting(exporter,RUBY_SMELTABLES, RecipeCategory.MISC,ModItems.RUBY, 18 | // 0.7f,200,"ruby"); 19 | // offerBlasting(exporter,RUBY_SMELTABLES, RecipeCategory.MISC,ModItems.RUBY, 20 | // 0.7f,100,"ruby"); 21 | // 22 | // offerReversibleCompactingRecipes(exporter, RecipeCategory.BUILDING_BLOCKS, ModItems.RUBY, RecipeCategory.DECORATIONS, 23 | // ModBlocks.RUBY_BLOCK); 24 | // 25 | // ShapedRecipeJsonBuilder.create(RecipeCategory.MISC,ModItems.RAW_RUBY,1) 26 | // .pattern("SSS") 27 | // .pattern("SRS") 28 | // .pattern("SSS") 29 | // .input('S', Items.STONE) 30 | // .input('R', ModItems.RUBY) 31 | // .criterion(hasItem(ModBlocks.WHATE_CAT_BLOCK),conditionsFromItem(ModBlocks.WHATE_CAT_BLOCK)) 32 | // .criterion(hasItem(ModItems.RUBY),conditionsFromItem(ModItems.RUBY)) 33 | // .offerTo(exporter, new Identifier(getRecipeName(ModItems.RAW_RUBY))); 34 | 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/datagen/ModitemTagProvider.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.datagen; 2 | 3 | import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; 4 | import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; 5 | import net.mafuyu33.mafishmod.item.ModItems; 6 | import net.minecraft.registry.RegistryWrapper; 7 | import net.minecraft.registry.tag.ItemTags; 8 | 9 | import java.util.concurrent.CompletableFuture; 10 | 11 | public class ModitemTagProvider extends FabricTagProvider.ItemTagProvider { 12 | public ModitemTagProvider(FabricDataOutput output, CompletableFuture completableFuture) { 13 | super(output, completableFuture); 14 | } 15 | 16 | @Override 17 | protected void configure(RegistryWrapper.WrapperLookup arg) { 18 | getOrCreateTagBuilder(ItemTags.TRIMMABLE_ARMOR) 19 | .add(ModItems.RUBY_HELMET,ModItems.RUBY_CHESTPLATE,ModItems.RUBY_LEGGINGS,ModItems.RUBY_BOOTS); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/effect/custom/NormalEffect.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.effect.custom; 2 | 3 | import net.minecraft.entity.effect.StatusEffect; 4 | import net.minecraft.entity.effect.StatusEffectCategory; 5 | 6 | public class NormalEffect extends StatusEffect { 7 | public NormalEffect(StatusEffectCategory category, int color) { 8 | super(category, color); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/enchantment/CursedLv1.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.enchantment; 2 | 3 | import net.minecraft.enchantment.Enchantment; 4 | import net.minecraft.enchantment.EnchantmentTarget; 5 | import net.minecraft.entity.EquipmentSlot; 6 | 7 | public class CursedLv1 extends Enchantment { 8 | 9 | 10 | protected CursedLv1(Rarity rarity, EnchantmentTarget target, EquipmentSlot[] slotTypes) { 11 | super(rarity, target, slotTypes); 12 | } 13 | 14 | public int getMaxLevel() { 15 | return 1; 16 | } 17 | 18 | public boolean isCursed() { 19 | return true; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/enchantment/CursedLv3.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.enchantment; 2 | 3 | import net.minecraft.enchantment.Enchantment; 4 | import net.minecraft.enchantment.EnchantmentTarget; 5 | import net.minecraft.entity.EquipmentSlot; 6 | 7 | public class CursedLv3 extends Enchantment { 8 | 9 | 10 | protected CursedLv3(Rarity rarity, EnchantmentTarget target, EquipmentSlot[] slotTypes) { 11 | super(rarity, target, slotTypes); 12 | } 13 | 14 | public int getMaxLevel() { 15 | return 3; 16 | } 17 | 18 | public boolean isCursed() { 19 | return true; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/enchantment/CursedLv5.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.enchantment; 2 | 3 | import net.minecraft.enchantment.Enchantment; 4 | import net.minecraft.enchantment.EnchantmentTarget; 5 | import net.minecraft.entity.EquipmentSlot; 6 | 7 | public class CursedLv5 extends Enchantment { 8 | 9 | protected CursedLv5(Rarity rarity, EnchantmentTarget target, EquipmentSlot[] slotTypes) { 10 | super(rarity, target, slotTypes); 11 | } 12 | 13 | public int getMaxLevel() { 14 | return 5; 15 | } 16 | 17 | public boolean isCursed() { 18 | return true; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/enchantment/CursedTreasureLv1.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.enchantment; 2 | 3 | import net.minecraft.enchantment.Enchantment; 4 | import net.minecraft.enchantment.EnchantmentTarget; 5 | import net.minecraft.entity.EquipmentSlot; 6 | 7 | public class CursedTreasureLv1 extends Enchantment { 8 | protected CursedTreasureLv1(Rarity rarity, EnchantmentTarget target, EquipmentSlot[] slotTypes) { 9 | super(rarity, target, slotTypes); 10 | } 11 | 12 | public boolean isTreasure() { 13 | return true; 14 | } 15 | public int getMaxLevel() { 16 | return 1; 17 | } 18 | 19 | public boolean isCursed() { 20 | return true; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/enchantment/NormalLv1.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.enchantment; 2 | 3 | import net.minecraft.enchantment.Enchantment; 4 | import net.minecraft.enchantment.EnchantmentTarget; 5 | import net.minecraft.entity.EquipmentSlot; 6 | 7 | public class NormalLv1 extends Enchantment { 8 | protected NormalLv1(Rarity rarity, EnchantmentTarget target, EquipmentSlot[] slotTypes) { 9 | super(rarity, target, slotTypes); 10 | } 11 | @Override 12 | public int getMaxLevel() { 13 | return 1; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/enchantment/NormalLv5.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.enchantment; 2 | 3 | import net.minecraft.enchantment.Enchantment; 4 | import net.minecraft.enchantment.EnchantmentTarget; 5 | import net.minecraft.entity.EquipmentSlot; 6 | 7 | public class NormalLv5 extends Enchantment { 8 | 9 | private static final int BASE_POWERS = 5; 10 | private static final int POWERS_PER_LEVEL = 11; 11 | private static final int MIN_MAX_POWER_DIFFERENCES = 20; 12 | 13 | protected NormalLv5(Rarity rarity, EnchantmentTarget target, EquipmentSlot[] slotTypes) { 14 | super(rarity, target, slotTypes); 15 | } 16 | 17 | public int getMinPower(int level) { 18 | return BASE_POWERS + (level - 1) * POWERS_PER_LEVEL; 19 | } 20 | 21 | public int getMaxPower(int level) { 22 | return this.getMinPower(level) + MIN_MAX_POWER_DIFFERENCES; 23 | } 24 | @Override 25 | public int getMaxLevel() { 26 | return 5; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/enchantment/TreasureLv1.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.enchantment; 2 | 3 | import net.minecraft.enchantment.Enchantment; 4 | import net.minecraft.enchantment.EnchantmentTarget; 5 | import net.minecraft.entity.EquipmentSlot; 6 | 7 | public class TreasureLv1 extends Enchantment { 8 | protected TreasureLv1(Rarity rarity, EnchantmentTarget target, EquipmentSlot[] slotTypes) { 9 | super(rarity, target, slotTypes); 10 | } 11 | 12 | public boolean isTreasure() { 13 | return true; 14 | } 15 | public int getMaxLevel() { 16 | return 1; 17 | } 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/event/BeforeBlockBreakHandler.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.event; 2 | 3 | import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; 4 | import net.mafuyu33.mafishmod.enchantmentblock.BlockEnchantmentStorage; 5 | import net.mafuyu33.mafishmod.item.ModItems; 6 | import net.minecraft.block.BlockState; 7 | import net.minecraft.block.entity.BlockEntity; 8 | import net.minecraft.enchantment.Enchantments; 9 | import net.minecraft.entity.player.PlayerEntity; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.world.World; 12 | import org.jetbrains.annotations.Nullable; 13 | 14 | public class BeforeBlockBreakHandler implements PlayerBlockBreakEvents.Before{ 15 | @Override 16 | public boolean beforeBlockBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity) { 17 | int k = BlockEnchantmentStorage.getLevel(Enchantments.PROTECTION,pos);//方块的破坏保护 18 | return k <= 0 || player.isCreative(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/event/ChatMessageHandler.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.event; 2 | 3 | import dev.architectury.event.CompoundEventResult; 4 | import dev.architectury.event.events.client.ClientChatEvent; 5 | 6 | 7 | public class ChatMessageHandler { 8 | private static int number = 999999999; 9 | 10 | public ChatMessageHandler(int number) { 11 | ChatMessageHandler.number = number; 12 | } 13 | public static void register() { 14 | // 注册客户端接收聊天消息事件监听器 15 | ClientChatEvent.RECEIVED.register((parameters, message) -> { 16 | 17 | 18 | // 在这里可以处理接收到的聊天消息, 获取“<玩家名称> 玩家输入的文字” 后面的文字 19 | String string = message.getString(); 20 | int index = string.indexOf('>'); 21 | String textAfterArrow = ""; 22 | if (index != -1 && index + 1 < string.length()) { 23 | textAfterArrow = string.substring(index + 1).trim(); 24 | } 25 | 26 | 27 | // 尝试将文本内容转换为整数 28 | try { 29 | number = Integer.parseInt(textAfterArrow); 30 | System.out.println("转换后的数字为: " + number); 31 | } catch (NumberFormatException e) { 32 | System.out.println("文本内容不是一个有效的数字。"); 33 | } 34 | 35 | // 注意:这里有两个参数,但我们将忽略第一个参数,因为它是消息类型参数 36 | 37 | // 返回 CompoundEventResult 来保持返回类型一致 38 | return CompoundEventResult.pass(); 39 | }); 40 | } 41 | 42 | public static int getNumber() { 43 | return number; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/event/ChunkLoadListener.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.event; 2 | 3 | //public class ChunkLoadListener { 4 | // public static void register() { 5 | // // 注册区块加载事件监听器 6 | // ClientChunkEvents.CHUNK_LOAD.register((world, chunk) -> { 7 | // System.out.println("区块加载啦啦啦啦"); 8 | // // 当区块加载时触发的逻辑 9 | // MinecraftClient.getInstance().execute(() -> { 10 | // 11 | // }); 12 | // }); 13 | // } 14 | //} 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/event/UseBlockHandler.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.event; 2 | 3 | import net.fabricmc.fabric.api.event.player.UseBlockCallback; 4 | import net.fabricmc.fabric.api.event.player.UseEntityCallback; 5 | import net.mafuyu33.mafishmod.config.ConfigHelper; 6 | import net.mafuyu33.mafishmod.item.ModItems; 7 | import net.minecraft.block.BlockState; 8 | import net.minecraft.entity.Entity; 9 | import net.minecraft.entity.passive.IronGolemEntity; 10 | import net.minecraft.entity.passive.LlamaEntity; 11 | import net.minecraft.entity.passive.VillagerEntity; 12 | import net.minecraft.entity.player.PlayerEntity; 13 | import net.minecraft.registry.tag.BlockTags; 14 | import net.minecraft.sound.SoundCategory; 15 | import net.minecraft.sound.SoundEvents; 16 | import net.minecraft.state.property.Properties; 17 | import net.minecraft.util.ActionResult; 18 | import net.minecraft.util.Hand; 19 | import net.minecraft.util.hit.BlockHitResult; 20 | import net.minecraft.util.hit.EntityHitResult; 21 | import net.minecraft.world.World; 22 | import org.jetbrains.annotations.Nullable; 23 | 24 | public class UseBlockHandler implements UseBlockCallback { 25 | public static boolean isButtonUsed=false; 26 | 27 | @Override 28 | public ActionResult interact(PlayerEntity player, World world, Hand hand, BlockHitResult hitResult) { 29 | if (!world.isClient) { 30 | BlockState blockState = world.getBlockState(hitResult.getBlockPos()); 31 | 32 | if (blockState.isIn(BlockTags.BUTTONS)) { 33 | // 检查按钮是否未被按下 34 | if (!blockState.get(Properties.POWERED)) { 35 | isButtonUsed = true; 36 | } 37 | } 38 | } 39 | return ActionResult.PASS; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/BreadSwordHotItem.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.mafuyu33.mafishmod.VRPlugin; 4 | import net.mafuyu33.mafishmod.util.VRDataHandler; 5 | import net.minecraft.entity.player.PlayerEntity; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.item.SwordItem; 8 | import net.minecraft.item.ToolMaterial; 9 | import net.minecraft.text.Text; 10 | import net.minecraft.util.Hand; 11 | import net.minecraft.util.TypedActionResult; 12 | import net.minecraft.util.math.Vec3d; 13 | import net.minecraft.world.World; 14 | 15 | 16 | public class BreadSwordHotItem extends SwordItem { 17 | public BreadSwordHotItem(ToolMaterial toolMaterial, int attackDamage, float attackSpeed, Settings settings) { 18 | super(toolMaterial, attackDamage, attackSpeed, settings); 19 | } 20 | 21 | // @Override 22 | // public TypedActionResult use(World world, PlayerEntity user, Hand hand) { 23 | //// ItemStack offhanditemStack = user.getOffHandStack(); 24 | //// System.out.println(offhanditemStack.getOrCreateNbt()); 25 | // if (world.isClient && VRPlugin.canRetrieveData(user)) { //有MC-VR-API并且在VR中的时候 26 | // Vec3d mainController = VRDataHandler.getControllerPosition(user, 0); 27 | // Vec3d offController = VRDataHandler.getControllerPosition(user, 1); 28 | // user.sendMessage(Text.literal("mainController"+mainController),false); 29 | // user.sendMessage(Text.literal("offController"+offController),false); 30 | // 31 | // 32 | // } 33 | // return TypedActionResult.success(this.getDefaultStack(), world.isClient()); 34 | // } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/ColliableItem.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.minecraft.entity.player.PlayerEntity; 4 | import net.minecraft.item.Item; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.text.Text; 7 | import net.minecraft.util.Hand; 8 | import net.minecraft.util.TypedActionResult; 9 | import net.minecraft.world.World; 10 | 11 | public class ColliableItem extends Item { 12 | public ColliableItem(Settings settings) { 13 | super(settings); 14 | } 15 | private static boolean colliable = false; 16 | @Override 17 | public TypedActionResult use(World world, PlayerEntity user, Hand hand) { 18 | ItemStack itemStack = user.getStackInHand(hand); 19 | if (!world.isClient) { 20 | colliable = !colliable; 21 | user.sendMessage(Text.literal(("已切换碰撞模式")),true); 22 | } 23 | return TypedActionResult.success(itemStack, world.isClient()); 24 | } 25 | 26 | public static boolean isColliable(){ 27 | return colliable; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/FireworkArrowItem.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.minecraft.item.*; 4 | 5 | public class FireworkArrowItem extends TippedArrowItem { 6 | 7 | public FireworkArrowItem(Settings settings) { 8 | super(settings); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/LightningBallItem.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.mafuyu33.mafishmod.entity.LightningProjectileEntity; 4 | import net.minecraft.entity.player.PlayerEntity; 5 | import net.minecraft.item.Item; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.sound.SoundCategory; 8 | import net.minecraft.sound.SoundEvents; 9 | import net.minecraft.stat.Stats; 10 | import net.minecraft.util.Hand; 11 | import net.minecraft.util.TypedActionResult; 12 | import net.minecraft.world.World; 13 | 14 | public class LightningBallItem extends Item { 15 | public LightningBallItem(Settings settings) { 16 | super(settings); 17 | } 18 | 19 | @Override 20 | public TypedActionResult use(World world, PlayerEntity user, Hand hand) { 21 | ItemStack itemStack = user.getStackInHand(hand); 22 | world.playSound(null, user.getX(), user.getY(), user.getZ(), 23 | SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5f, 0.4f / (world.getRandom().nextFloat() * 0.4f + 0.8f)); 24 | 25 | if (!world.isClient) { 26 | LightningProjectileEntity lightningProjectileEntity = new LightningProjectileEntity(user, world); 27 | lightningProjectileEntity.setItem(itemStack); 28 | lightningProjectileEntity.setVelocity(user, user.getPitch(), user.getYaw(), 0.0f, 1.5f, 1.0f); 29 | world.spawnEntity(lightningProjectileEntity); 30 | } 31 | 32 | user.incrementStat(Stats.USED.getOrCreateStat(this)); 33 | if (!user.getAbilities().creativeMode) { 34 | itemStack.decrement(1); 35 | } 36 | return TypedActionResult.success(itemStack, world.isClient()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/LlamaItem.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.mafuyu33.mafishmod.entity.CustomLlamaSpitEntity; 4 | import net.minecraft.entity.player.PlayerEntity; 5 | import net.minecraft.item.Item; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.sound.SoundCategory; 8 | import net.minecraft.sound.SoundEvents; 9 | import net.minecraft.util.Hand; 10 | import net.minecraft.util.TypedActionResult; 11 | import net.minecraft.world.World; 12 | 13 | public class LlamaItem extends Item { 14 | public LlamaItem(Settings settings) { 15 | super(settings); 16 | } 17 | @Override 18 | public TypedActionResult use(World world, PlayerEntity user, Hand hand) { 19 | world.playSound(null, user.getX(), user.getY(), user.getZ(), 20 | SoundEvents.ENTITY_LLAMA_SPIT, SoundCategory.NEUTRAL, 0.5f, 0.4f / (world.getRandom().nextFloat() * 0.4f + 0.8f)); 21 | if (!world.isClient) { 22 | CustomLlamaSpitEntity llamaSpitEntity = new CustomLlamaSpitEntity(world,user); 23 | llamaSpitEntity.setVelocity(user, user.getPitch(), user.getYaw(), 0.0f, 1.5f, 1.0f); 24 | world.spawnEntity(llamaSpitEntity); 25 | } 26 | return super.use(world, user, hand); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/MathSwordItem.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.mafuyu33.mafishmod.enchantment.ModEnchantments; 4 | import net.minecraft.enchantment.EnchantmentHelper; 5 | import net.minecraft.entity.player.PlayerEntity; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.item.SwordItem; 8 | import net.minecraft.item.ToolMaterial; 9 | import net.minecraft.text.Text; 10 | import net.minecraft.util.Hand; 11 | import net.minecraft.util.TypedActionResult; 12 | import net.minecraft.world.World; 13 | 14 | public class MathSwordItem extends SwordItem { 15 | public MathSwordItem(ToolMaterial toolMaterial, int attackDamage, float attackSpeed, Settings settings) { 16 | super(toolMaterial, attackDamage, attackSpeed, settings); 17 | } 18 | private static boolean mathMode = false; 19 | private static int level = 0; 20 | @Override 21 | public TypedActionResult use(World world, PlayerEntity user, Hand hand) { 22 | ItemStack itemStack = user.getStackInHand(hand); 23 | 24 | level = EnchantmentHelper.getLevel(ModEnchantments.VERY_EASY, itemStack); 25 | 26 | if (!world.isClient) { 27 | mathMode = !mathMode; 28 | } 29 | 30 | if(mathMode){ 31 | user.sendMessage(Text.literal(("数学领域展开")),true); 32 | }else 33 | { 34 | user.sendMessage(Text.literal(("数学领域关闭")),true); 35 | } 36 | 37 | return TypedActionResult.success(itemStack, world.isClient()); 38 | } 39 | 40 | public static boolean isMathMode() { 41 | return mathMode; 42 | } 43 | 44 | public static int getLevel() { 45 | return level; 46 | } 47 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/MilkFleshItem.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.minecraft.advancement.criterion.Criteria; 4 | import net.minecraft.entity.LivingEntity; 5 | import net.minecraft.entity.player.PlayerEntity; 6 | import net.minecraft.item.Item; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.server.network.ServerPlayerEntity; 9 | import net.minecraft.stat.Stats; 10 | import net.minecraft.util.ActionResult; 11 | import net.minecraft.util.Hand; 12 | import net.minecraft.world.World; 13 | 14 | public class MilkFleshItem extends Item { 15 | 16 | 17 | public MilkFleshItem(Settings settings) { 18 | super(settings); 19 | } 20 | 21 | 22 | @Override 23 | public ActionResult useOnEntity(ItemStack stack, PlayerEntity user, LivingEntity entity, Hand hand) { 24 | if (user instanceof PlayerEntity && !((PlayerEntity)user).getAbilities().creativeMode) { 25 | stack.decrement(1); 26 | } 27 | entity.clearStatusEffects(); 28 | return super.useOnEntity(stack, user, entity, hand); 29 | } 30 | public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) { 31 | if (user instanceof ServerPlayerEntity serverPlayerEntity) { 32 | Criteria.CONSUME_ITEM.trigger(serverPlayerEntity, stack); 33 | serverPlayerEntity.incrementStat(Stats.USED.getOrCreateStat(this)); 34 | } 35 | 36 | if (user instanceof PlayerEntity && !((PlayerEntity)user).getAbilities().creativeMode) { 37 | stack.decrement(1); 38 | } 39 | 40 | if (!world.isClient) { 41 | user.clearStatusEffects(); 42 | } 43 | 44 | return stack; 45 | } 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/ModStatusEffects.java: -------------------------------------------------------------------------------- 1 | //package net.mafuyu33.mafishmod.item.custom; 2 | // 3 | //import net.minecraft.entity.attribute.EntityAttributeInstance; 4 | //import net.minecraft.entity.effect.StatusEffect; 5 | //import net.minecraft.entity.effect.StatusEffectCategory; 6 | //import net.minecraft.entity.effect.StatusEffects; 7 | //import net.minecraft.registry.Registries; 8 | //import net.minecraft.registry.Registry; 9 | //import net.minecraft.util.Identifier; 10 | // 11 | //import static net.mafuyu33.mafishmod.TutorialMod.MOD_ID; 12 | // 13 | // 14 | //public class ModStatusEffects{ 15 | // public static final StatusEffect IRONMAN = new IronStatusEffect(); 16 | // 17 | // // 构造函数为空的私有类,用于表示IRON效果 18 | // private static class IronStatusEffect extends StatusEffect { 19 | // public IronStatusEffect() { 20 | // super(StatusEffectCategory.BENEFICIAL, 0xFF0000); // 设置类别和颜色(红色) 21 | // } 22 | // } 23 | // 24 | // 25 | // private static void ironAttributeModifiers(EntityAttributeInstance instance) { 26 | // // 可以在这里添加自定义效果对实体属性的修改 27 | // } 28 | // 29 | // public static void registerModEffect(){ 30 | // Registry.register(Registries.STATUS_EFFECT, new Identifier(MOD_ID, "ironman"), ModStatusEffects.IRONMAN); 31 | // } 32 | // 33 | //} 34 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/PoisonSwordItem.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.minecraft.entity.LivingEntity; 4 | import net.minecraft.entity.effect.StatusEffectInstance; 5 | import net.minecraft.entity.effect.StatusEffects; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.item.SwordItem; 8 | import net.minecraft.item.ToolMaterial; 9 | import net.minecraft.world.World; 10 | 11 | public class PoisonSwordItem extends SwordItem { 12 | public PoisonSwordItem(ToolMaterial toolMaterial, int attackDamage, float attackSpeed, Settings settings) { 13 | super(toolMaterial, attackDamage, attackSpeed, settings); 14 | } 15 | private int delayTimer = 0; 16 | 17 | @Override 18 | public void usageTick(World world, LivingEntity user, ItemStack stack, int remainingUseTicks) { 19 | if (delayTimer < 16) { 20 | delayTimer++; 21 | } else { 22 | user.addStatusEffect(new StatusEffectInstance(StatusEffects.POISON, 400, 0)); 23 | delayTimer = 0; 24 | } 25 | 26 | 27 | if(user.getHealth()==1){ 28 | user.addStatusEffect(new StatusEffectInstance(StatusEffects.INSTANT_DAMAGE,10,0)); 29 | } 30 | } 31 | 32 | @Override 33 | public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { 34 | target.addStatusEffect(new StatusEffectInstance(StatusEffects.POISON,200,0)); 35 | return super.postHit(stack, target, attacker); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/RTX4090Item.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.mafuyu33.mafishmod.entity.FuProjectileEntity; 4 | import net.mafuyu33.mafishmod.sound.ModSounds; 5 | import net.minecraft.entity.player.PlayerEntity; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.item.PickaxeItem; 8 | import net.minecraft.item.ToolMaterial; 9 | import net.minecraft.sound.SoundCategory; 10 | import net.minecraft.sound.SoundEvents; 11 | import net.minecraft.stat.Stats; 12 | import net.minecraft.util.Hand; 13 | import net.minecraft.util.TypedActionResult; 14 | import net.minecraft.world.World; 15 | 16 | 17 | public class RTX4090Item extends PickaxeItem { 18 | 19 | public RTX4090Item(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) { 20 | super(material, attackDamage, attackSpeed, settings); 21 | } 22 | 23 | 24 | @Override 25 | public TypedActionResult use(World world, PlayerEntity user, Hand hand) { 26 | ItemStack itemStack = user.getStackInHand(hand); 27 | world.playSound(null, user.getX(), user.getY(), user.getZ(), 28 | ModSounds.PIN, SoundCategory.PLAYERS, 0.5f, 0.4f / (world.getRandom().nextFloat() * 0.4f + 0.8f)); 29 | return TypedActionResult.success(itemStack, world.isClient()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/StargazyPieItem.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.minecraft.entity.LivingEntity; 4 | import net.minecraft.entity.effect.StatusEffectInstance; 5 | import net.minecraft.entity.effect.StatusEffects; 6 | import net.minecraft.entity.player.PlayerEntity; 7 | import net.minecraft.item.*; 8 | import net.minecraft.server.world.ServerWorld; 9 | import net.minecraft.util.ActionResult; 10 | import net.minecraft.util.Hand; 11 | import net.minecraft.world.World; 12 | 13 | public class StargazyPieItem extends Item { 14 | 15 | 16 | public StargazyPieItem(Settings settings) { 17 | super(settings); 18 | } 19 | 20 | 21 | 22 | @Override 23 | public ActionResult useOnEntity(ItemStack stack, PlayerEntity user, LivingEntity entity, Hand hand) { 24 | entity.addStatusEffect(new StatusEffectInstance(StatusEffects.POISON, 200, 0)); 25 | return super.useOnEntity(stack, user, entity, hand); 26 | } 27 | 28 | @Override 29 | public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { 30 | target.addStatusEffect(new StatusEffectInstance(StatusEffects.POISON, 200, 0)); 31 | return super.postHit(stack, target, attacker); 32 | } 33 | 34 | @Override 35 | public void onStoppedUsing(ItemStack stack, World world, LivingEntity user, int remainingUseTicks) { 36 | super.onStoppedUsing(stack, world, user, remainingUseTicks); 37 | if(world instanceof ServerWorld serverWorld) { 38 | serverWorld.setTimeOfDay(18000); 39 | } 40 | } 41 | } 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/StoneBallItem.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.mafuyu33.mafishmod.entity.StoneBallProjectileEntity; 4 | import net.minecraft.entity.player.PlayerEntity; 5 | import net.minecraft.item.Item; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.sound.SoundCategory; 8 | import net.minecraft.sound.SoundEvents; 9 | import net.minecraft.stat.Stats; 10 | import net.minecraft.util.Hand; 11 | import net.minecraft.util.TypedActionResult; 12 | import net.minecraft.world.World; 13 | 14 | public class StoneBallItem extends Item { 15 | public StoneBallItem(Settings settings) { 16 | super(settings); 17 | } 18 | 19 | @Override 20 | public TypedActionResult use(World world, PlayerEntity user, Hand hand) { 21 | ItemStack itemStack = user.getStackInHand(hand); 22 | world.playSound(null, user.getX(), user.getY(), user.getZ(), 23 | SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5f, 0.4f / (world.getRandom().nextFloat() * 0.4f + 0.8f)); 24 | 25 | if (!world.isClient) { 26 | StoneBallProjectileEntity stoneBallProjectileEntity = new StoneBallProjectileEntity(user, world); 27 | stoneBallProjectileEntity.setItem(itemStack); 28 | stoneBallProjectileEntity.setVelocity(user, user.getPitch(), user.getYaw(), 0.0f, 1.5f, 1.0f); 29 | world.spawnEntity(stoneBallProjectileEntity); 30 | } 31 | 32 | user.incrementStat(Stats.USED.getOrCreateStat(this)); 33 | if (!user.getAbilities().creativeMode) { 34 | itemStack.decrement(1); 35 | } 36 | return TypedActionResult.success(itemStack, world.isClient()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/TNTBallItem.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.mafuyu33.mafishmod.entity.TNTProjectileEntity; 4 | import net.minecraft.entity.player.PlayerEntity; 5 | import net.minecraft.item.Item; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.sound.SoundCategory; 8 | import net.minecraft.sound.SoundEvents; 9 | import net.minecraft.stat.Stats; 10 | import net.minecraft.util.Hand; 11 | import net.minecraft.util.TypedActionResult; 12 | import net.minecraft.world.World; 13 | 14 | public class TNTBallItem extends Item { 15 | public TNTBallItem(Settings settings) { 16 | super(settings); 17 | } 18 | 19 | @Override 20 | public TypedActionResult use(World world, PlayerEntity user, Hand hand) { 21 | ItemStack itemStack = user.getStackInHand(hand); 22 | world.playSound(null, user.getX(), user.getY(), user.getZ(), 23 | SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5f, 0.4f / (world.getRandom().nextFloat() * 0.4f + 0.8f)); 24 | 25 | if (!world.isClient) { 26 | TNTProjectileEntity tntProjectileEntity = new TNTProjectileEntity(user, world); 27 | tntProjectileEntity.setItem(itemStack); 28 | tntProjectileEntity.setVelocity(user, user.getPitch(), user.getYaw(), 0.0f, 1.5f, 1.0f); 29 | world.spawnEntity(tntProjectileEntity); 30 | } 31 | 32 | user.incrementStat(Stats.USED.getOrCreateStat(this)); 33 | if (!user.getAbilities().creativeMode) { 34 | itemStack.decrement(1); 35 | } 36 | return TypedActionResult.success(itemStack, world.isClient()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/custom/VillagerItem.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.item.custom; 2 | 3 | import net.minecraft.client.item.TooltipContext; 4 | import net.minecraft.item.Item; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.text.Text; 7 | import net.minecraft.world.World; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | import java.util.List; 11 | 12 | public class VillagerItem extends Item { 13 | public VillagerItem(Settings settings) { 14 | super(settings); 15 | } 16 | @Override 17 | public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { 18 | tooltip.add(Text.translatable("tooltip.mafishmod.villager_item.tooltip")); 19 | super.appendTooltip(stack, world, tooltip, context); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/item/vrcustom/CatchyouItem.java: -------------------------------------------------------------------------------- 1 | //package net.mafuyu33.mafishmod.item.vrcustom; 2 | // 3 | //import net.minecraft.entity.player.PlayerEntity; 4 | //import net.minecraft.item.Item; 5 | //import net.minecraft.item.ItemStack; 6 | //import net.minecraft.text.Text; 7 | //import net.minecraft.util.Hand; 8 | //import net.minecraft.util.TypedActionResult; 9 | //import net.minecraft.world.World; 10 | //import org.vivecraft.api_beta.VivecraftAPI; 11 | //import org.vivecraft.client_vr.provider.MCVR; 12 | // 13 | //public class CatchyouItem extends Item { 14 | // public CatchyouItem(Settings settings) { 15 | // super(settings); 16 | // } 17 | // 18 | // @Override 19 | // public TypedActionResult use(World world, PlayerEntity user, Hand hand) { 20 | // return super.use(world, user, hand); 21 | // if(MCVR.get().isActive()){ 22 | // user.sendMessage(Text.literal((String.valueOf(123))),false); 23 | // } 24 | // } 25 | //} 26 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/ExampleMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin; 2 | 3 | import net.minecraft.server.MinecraftServer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | 9 | @Mixin(MinecraftServer.class) 10 | public abstract class ExampleMixin { 11 | @Inject(at = @At("HEAD"), method = "loadWorld") 12 | private void init(CallbackInfo info) { 13 | // This code is injected into the start of MinecraftServer.loadWorld()V 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/ParticleManagerMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin; 2 | 3 | import net.mafuyu33.mafishmod.util.EvictingLinkedHashSetQueue; 4 | import net.minecraft.client.particle.Particle; 5 | import net.minecraft.client.particle.ParticleManager; 6 | import net.minecraft.client.particle.ParticleTextureSheet; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.*; 9 | 10 | import java.util.Queue; 11 | import java.util.function.Function; 12 | 13 | @Mixin(ParticleManager.class) 14 | public abstract class ParticleManagerMixin {//增加粒子数量上限 15 | 16 | // @ModifyArg(method = "tick", at = @At(value = "INVOKE", target = "Ljava/util/Map;computeIfAbsent(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;"), index = 1) 17 | // private EvictingQueue injected(EvictingQueue originalQueue) { 18 | // int maxSize = 10; // 设置新的最大大小值 19 | // return EvictingQueue.create(maxSize); 20 | // } 21 | 22 | @ModifyArg(method = "tick", at = @At(value = "INVOKE", target = "Ljava/util/Map;computeIfAbsent(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;"), index = 1) 23 | private Function> madparticleUseEvictingLinkedHashSetQueueInsteadOfEvictingQueue(Function> mappingFunction) { 24 | return t -> new EvictingLinkedHashSetQueue<>(16384, 999999999); 25 | } 26 | 27 | 28 | 29 | 30 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/effectmixin/canclimb/LivingEntityMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.effectmixin.canclimb; 2 | 3 | import net.mafuyu33.mafishmod.effect.ModStatusEffects; 4 | import net.minecraft.entity.Entity; 5 | import net.minecraft.entity.EntityType; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.entity.effect.StatusEffect; 8 | import net.minecraft.world.World; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 14 | 15 | @Mixin(LivingEntity.class) 16 | public abstract class LivingEntityMixin extends Entity { 17 | @Shadow public abstract boolean hasStatusEffect(StatusEffect effect); 18 | 19 | public LivingEntityMixin(EntityType type, World world) { 20 | super(type, world); 21 | } 22 | 23 | @Inject(at = @At("HEAD"), method = "isClimbing", cancellable = true) 24 | private void init(CallbackInfoReturnable cir) { 25 | if(this.hasStatusEffect(ModStatusEffects.SPIDER_EFFECT)) { 26 | if (this.horizontalCollision) { 27 | cir.setReturnValue(true); 28 | } 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/effectmixin/sheep/LimbAnimatorAccessor.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.effectmixin.sheep; 2 | 3 | import net.minecraft.entity.LimbAnimator; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(LimbAnimator.class) 8 | public interface LimbAnimatorAccessor { 9 | 10 | @Accessor 11 | float getPrevSpeed(); 12 | 13 | @Accessor 14 | void setPrevSpeed(float prevSpeed); 15 | 16 | @Accessor 17 | float getSpeed(); 18 | 19 | @Accessor 20 | void setSpeed(float speed); 21 | 22 | @Accessor 23 | float getPos(); 24 | 25 | @Accessor 26 | void setPos(float pos); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/effectmixin/sheep/LivingEntityMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.effectmixin.sheep; 2 | 3 | import net.mafuyu33.mafishmod.effect.ModStatusEffects; 4 | import net.minecraft.entity.*; 5 | import net.minecraft.entity.effect.StatusEffect; 6 | import net.minecraft.entity.passive.SheepEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.server.world.ServerWorld; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.util.math.Vec3d; 11 | import net.minecraft.world.World; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | import org.spongepowered.asm.mixin.Shadow; 14 | import org.spongepowered.asm.mixin.injection.At; 15 | import org.spongepowered.asm.mixin.injection.Inject; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 17 | 18 | @Mixin(LivingEntity.class) 19 | public abstract class LivingEntityMixin extends Entity implements Attackable { 20 | @Shadow public abstract boolean hasStatusEffect(StatusEffect effect); 21 | 22 | @Shadow public abstract void remove(RemovalReason reason); 23 | 24 | @Shadow public abstract ItemStack eatFood(World world, ItemStack stack); 25 | 26 | public LivingEntityMixin(EntityType type, World world) { 27 | super(type, world); 28 | } 29 | 30 | @Inject(at = @At("HEAD"), method = "tick") 31 | private void init(CallbackInfo info) { 32 | if(!this.getWorld().isClient) { 33 | if (this.hasStatusEffect(ModStatusEffects.SHEEP_EFFECT)) {//变羊药水 34 | if (!this.isPlayer()) {//如果不是玩家的话 35 | Vec3d pos = this.getPos(); 36 | EntityType.SHEEP.spawn(((ServerWorld) this.getWorld()), BlockPos.ofFloored(pos), SpawnReason.TRIGGERED); 37 | this.remove(RemovalReason.KILLED); 38 | } 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/custom/fallprotection/BlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.custom.fallprotection; 2 | 3 | import net.mafuyu33.mafishmod.enchantmentblock.BlockEnchantmentStorage; 4 | import net.minecraft.block.Block; 5 | import net.minecraft.block.BlockState; 6 | import net.minecraft.enchantment.Enchantments; 7 | import net.minecraft.entity.Entity; 8 | import net.minecraft.entity.LivingEntity; 9 | import net.minecraft.entity.damage.DamageSource; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.world.World; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.Inject; 15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 17 | 18 | @Mixin(Block.class) 19 | public abstract class BlockMixin { 20 | @Inject(at = @At("HEAD"), method = "onLandedUpon",cancellable = true) 21 | private void init(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance, CallbackInfo ci) { 22 | int i = BlockEnchantmentStorage.getLevel(Enchantments.FEATHER_FALLING, pos); 23 | if (i > 0){ 24 | entity.handleFallDamage(fallDistance, (-0.25F * i + 1), entity.getDamageSources().fall()); 25 | ci.cancel(); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/custom/fasthopper/HopperBlockEntityMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.custom.fasthopper; 2 | 3 | import net.mafuyu33.mafishmod.enchantmentblock.BlockEnchantmentStorage; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.entity.HopperBlockEntity; 6 | import net.minecraft.enchantment.Enchantments; 7 | import net.minecraft.inventory.Inventory; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 14 | 15 | import java.util.function.BooleanSupplier; 16 | 17 | @Mixin(HopperBlockEntity.class) 18 | public abstract class HopperBlockEntityMixin { 19 | @Inject(at = @At("RETURN"), method = "insertAndExtract") 20 | private static void init1(World world, BlockPos pos, BlockState state, HopperBlockEntity blockEntity, BooleanSupplier booleanSupplier, CallbackInfoReturnable cir) { 21 | int k = BlockEnchantmentStorage.getLevel(Enchantments.QUICK_CHARGE,pos);//漏斗的快速装填 22 | // System.out.println("传递一次"); 23 | if(k>0){ 24 | // System.out.println("设置冷却"); 25 | blockEntity.setTransferCooldown(0); 26 | } 27 | } 28 | 29 | @Inject(at = @At("HEAD"), method = "insert",cancellable = true) 30 | private static void init2(World world, BlockPos pos, BlockState state, Inventory inventory, CallbackInfoReturnable cir){ 31 | int k = BlockEnchantmentStorage.getLevel(Enchantments.BINDING_CURSE,pos);//漏斗的绑定诅咒 32 | if(k>0){ 33 | System.out.println("取消传递!"); 34 | cir.cancel(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/custom/knockback/AbstractBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.custom.knockback; 2 | 3 | import net.mafuyu33.mafishmod.enchantmentblock.BlockEnchantmentStorage; 4 | import net.minecraft.block.AbstractBlock; 5 | import net.minecraft.block.BlockState; 6 | import net.minecraft.enchantment.Enchantments; 7 | import net.minecraft.entity.Entity; 8 | import net.minecraft.entity.player.PlayerEntity; 9 | import net.minecraft.resource.featuretoggle.ToggleableFeature; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.util.math.Box; 12 | import net.minecraft.util.math.Vec3d; 13 | import net.minecraft.world.World; 14 | import org.spongepowered.asm.mixin.Mixin; 15 | import org.spongepowered.asm.mixin.Unique; 16 | import org.spongepowered.asm.mixin.injection.At; 17 | import org.spongepowered.asm.mixin.injection.Inject; 18 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 19 | 20 | @Mixin(AbstractBlock.class) 21 | public abstract class AbstractBlockMixin implements ToggleableFeature { 22 | @Inject(at = @At("HEAD"), method = "onEntityCollision") 23 | private void init3(BlockState state, World world, BlockPos pos, Entity entity, CallbackInfo ci) { 24 | int k = BlockEnchantmentStorage.getLevel(Enchantments.KNOCKBACK,pos); 25 | if (!world.isClient() && k > 0) { 26 | entity.addVelocity(0,k*0.5,0); 27 | } 28 | if (world.isClient() && k > 0 && entity instanceof PlayerEntity player) {//如果有击退附魔 29 | player.addVelocity(0,k*0.5,0); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/custom/knockback/AbstractPressurePlateBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.custom.knockback; 2 | 3 | import net.mafuyu33.mafishmod.enchantmentblock.BlockEnchantmentStorage; 4 | import net.minecraft.block.AbstractPressurePlateBlock; 5 | import net.minecraft.block.Block; 6 | import net.minecraft.block.BlockState; 7 | import net.minecraft.block.CactusBlock; 8 | import net.minecraft.enchantment.Enchantments; 9 | import net.minecraft.entity.Entity; 10 | import net.minecraft.entity.player.PlayerEntity; 11 | import net.minecraft.util.math.BlockPos; 12 | import net.minecraft.world.World; 13 | import org.spongepowered.asm.mixin.Mixin; 14 | import org.spongepowered.asm.mixin.injection.At; 15 | import org.spongepowered.asm.mixin.injection.Inject; 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 17 | 18 | @Mixin(AbstractPressurePlateBlock.class) 19 | public abstract class AbstractPressurePlateBlockMixin extends Block { 20 | public AbstractPressurePlateBlockMixin(Settings settings) { 21 | super(settings); 22 | } 23 | 24 | @Inject(at = @At("HEAD"), method = "onEntityCollision") 25 | private void init3(BlockState state, World world, BlockPos pos, Entity entity, CallbackInfo ci) { 26 | int k = BlockEnchantmentStorage.getLevel(Enchantments.KNOCKBACK,pos); 27 | if (!world.isClient() && k > 0) { 28 | entity.addVelocity(0,k*0.5,0); 29 | } 30 | if (world.isClient() && k > 0 && entity instanceof PlayerEntity player) {//如果有击退附魔 31 | player.addVelocity(0,k*0.5,0); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/custom/knockback/BlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.custom.knockback; 2 | 3 | import net.fabricmc.fabric.api.block.v1.FabricBlock; 4 | import net.mafuyu33.mafishmod.enchantmentblock.BlockEnchantmentStorage; 5 | import net.minecraft.block.AbstractBlock; 6 | import net.minecraft.block.Block; 7 | import net.minecraft.block.BlockState; 8 | import net.minecraft.enchantment.Enchantments; 9 | import net.minecraft.entity.Entity; 10 | import net.minecraft.entity.player.PlayerEntity; 11 | import net.minecraft.item.ItemConvertible; 12 | import net.minecraft.util.math.BlockPos; 13 | import net.minecraft.world.World; 14 | import org.spongepowered.asm.mixin.Mixin; 15 | import org.spongepowered.asm.mixin.injection.At; 16 | import org.spongepowered.asm.mixin.injection.Inject; 17 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 18 | 19 | @Mixin(Block.class) 20 | public abstract class BlockMixin extends AbstractBlock implements ItemConvertible, FabricBlock { 21 | public BlockMixin(Settings settings) { 22 | super(settings); 23 | } 24 | 25 | @Inject(at = @At("HEAD"), method = "onSteppedOn") 26 | private void init(World world, BlockPos pos, BlockState state, Entity entity, CallbackInfo ci) { 27 | int k = BlockEnchantmentStorage.getLevel(Enchantments.KNOCKBACK,pos); 28 | if (!world.isClient() && k > 0) {//如果有击退附魔 29 | entity.addVelocity(0,k*0.5,0); 30 | } 31 | if (world.isClient() && k > 0 && entity instanceof PlayerEntity player) {//如果有击退附魔 32 | player.addVelocity(0,k*0.5,0); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/custom/knockback/LivingEntityMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.custom.knockback; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraft.entity.LivingEntity; 5 | import net.minecraft.server.MinecraftServer; 6 | import net.minecraft.util.math.BlockPos; 7 | import net.minecraft.util.math.Box; 8 | import net.minecraft.util.math.Vec3d; 9 | import net.minecraft.world.World; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.Unique; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(LivingEntity.class) 17 | public abstract class LivingEntityMixin { 18 | @Inject(at = @At("HEAD"), method = "tick") 19 | private void init(CallbackInfo info) { 20 | // 21 | // if(getDirectionVectorIfTouching(this,)) 22 | } 23 | @Unique 24 | private static Vec3d getDirectionVectorIfTouching(Entity entity, BlockPos blockPos) { 25 | // 获取实体的碰撞箱 26 | Box entityBox = entity.getBoundingBox(); 27 | // 创建代表方块的碰撞箱 28 | Box blockBox = new Box(blockPos.getX(), blockPos.getY(), blockPos.getZ(), 29 | blockPos.getX() + 1.0, blockPos.getY() + 1.0, blockPos.getZ() + 1.0); 30 | 31 | // 检查实体的碰撞箱是否与方块的碰撞箱相交 32 | if (entityBox.intersects(blockBox)) { 33 | // 获取方块碰撞箱的中心点 34 | Vec3d blockCenter = new Vec3d(blockPos.getX() + 0.5, blockPos.getY() + 0.5, blockPos.getZ() + 0.5); 35 | // 获取实体碰撞箱的中心点 36 | Vec3d entityCenter = entityBox.getCenter(); 37 | 38 | // 计算从方块中心到实体中心的方向向量 39 | return entityCenter.subtract(blockCenter); 40 | } else { 41 | // 如果没有碰撞,返回 null 42 | return null; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/custom/respiration/FlowableFluidMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.custom.respiration; 2 | 3 | import net.mafuyu33.mafishmod.enchantmentblock.BlockEnchantmentStorage; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.enchantment.Enchantments; 6 | import net.minecraft.fluid.FlowableFluid; 7 | import net.minecraft.fluid.FluidState; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.util.math.Direction; 10 | import net.minecraft.world.WorldAccess; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(FlowableFluid.class) 17 | public abstract class FlowableFluidMixin { 18 | @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/fluid/FlowableFluid;beforeBreakingBlock(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V"), method = "flow",cancellable = true) 19 | private void init(WorldAccess world, BlockPos pos, BlockState state, Direction direction, FluidState fluidState, CallbackInfo ci) { 20 | if(BlockEnchantmentStorage.getLevel(Enchantments.RESPIRATION,pos)>0){ 21 | ci.cancel(); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/custom/thorns/AbstractBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.custom.thorns; 2 | 3 | import net.mafuyu33.mafishmod.enchantmentblock.BlockEnchantmentStorage; 4 | import net.minecraft.block.AbstractBlock; 5 | import net.minecraft.block.BlockState; 6 | import net.minecraft.enchantment.Enchantments; 7 | import net.minecraft.entity.Entity; 8 | import net.minecraft.resource.featuretoggle.ToggleableFeature; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(AbstractBlock.class) 17 | public abstract class AbstractBlockMixin implements ToggleableFeature { 18 | @Inject(at = @At("HEAD"), method = "onEntityCollision")//荆棘附魔,踩上去受伤 19 | private void init3(BlockState state, World world, BlockPos pos, Entity entity, CallbackInfo ci) { 20 | int k = BlockEnchantmentStorage.getLevel(Enchantments.THORNS,pos); 21 | if (!world.isClient() && k > 0) {//如果有荆棘附魔 22 | entity.damage(entity.getDamageSources().cactus(),(float) k); 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/WorldMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main; 2 | 3 | import net.mafuyu33.mafishmod.enchantmentblock.BlockEnchantmentStorage; 4 | import net.minecraft.entity.Entity; 5 | import net.minecraft.nbt.NbtList; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 15 | 16 | import java.util.Objects; 17 | 18 | @Mixin(World.class) 19 | public abstract class WorldMixin { 20 | @Shadow public abstract boolean isClient(); 21 | 22 | @Inject(at = @At("HEAD"), method = "breakBlock") 23 | private void init(BlockPos pos, boolean drop, Entity breakingEntity, int maxUpdateDepth, CallbackInfoReturnable cir) { 24 | if (!this.isClient()) { 25 | if (!Objects.equals(BlockEnchantmentStorage.getEnchantmentsAtPosition(pos), new NbtList())) { 26 | BlockEnchantmentStorage.removeBlockEnchantment(pos.toImmutable());//删除信息 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/AbstractBannerBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.AbstractBannerBlock; 5 | import net.minecraft.block.BlockState; 6 | import net.minecraft.block.BlockWithEntity; 7 | import net.minecraft.entity.LivingEntity; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | import org.jetbrains.annotations.Nullable; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.Inject; 15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 16 | @Mixin(AbstractBannerBlock.class) 17 | public abstract class AbstractBannerBlockMixin extends BlockWithEntity { 18 | protected AbstractBannerBlockMixin(Settings settings) { 19 | super(settings); 20 | } 21 | 22 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 23 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 24 | InjectHelper.onPlacedInject(world,itemStack,pos); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/AbstractFurnaceBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.AbstractFurnaceBlock; 5 | import net.minecraft.block.BlockState; 6 | import net.minecraft.block.BlockWithEntity; 7 | import net.minecraft.entity.LivingEntity; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | import org.jetbrains.annotations.Nullable; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.Inject; 15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 16 | 17 | @Mixin(AbstractFurnaceBlock.class) 18 | public abstract class AbstractFurnaceBlockMixin extends BlockWithEntity { 19 | protected AbstractFurnaceBlockMixin(Settings settings) { 20 | super(settings); 21 | } 22 | 23 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 24 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 25 | InjectHelper.onPlacedInject(world,itemStack,pos); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/AbstractRedStoneGateBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.AbstractRedstoneGateBlock; 5 | import net.minecraft.block.BlockState; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(AbstractRedstoneGateBlock.class) 17 | public abstract class AbstractRedStoneGateBlockMixin{ 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/BarrelBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BarrelBlock; 5 | import net.minecraft.block.BlockState; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(BarrelBlock.class) 17 | public abstract class BarrelBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/BeaconMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BeaconBlock; 5 | import net.minecraft.block.BlockState; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(BeaconBlock.class) 17 | public abstract class BeaconMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/BrewingStandBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.BrewingStandBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(BrewingStandBlock.class) 17 | public abstract class BrewingStandBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/ChestBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.ChestBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(ChestBlock.class) 17 | public abstract class ChestBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/CobwebBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.enchantmentblock.BlockEnchantmentStorage; 4 | import net.minecraft.block.*; 5 | import net.minecraft.enchantment.Enchantments; 6 | import net.minecraft.entity.Entity; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 | 14 | @Mixin(CobwebBlock.class) 15 | public abstract class CobwebBlockMixin extends Block { 16 | protected CobwebBlockMixin(Settings settings) { 17 | super(settings); 18 | } 19 | 20 | @Inject(at = @At("HEAD"), method = "onEntityCollision")//存储方块的附魔 21 | private void init1(BlockState state, World world, BlockPos pos, Entity entity, CallbackInfo ci) { 22 | int k = BlockEnchantmentStorage.getLevel(Enchantments.THORNS,pos); 23 | if (!world.isClient() && k > 0) {//如果有荆棘附魔 24 | entity.damage(entity.getDamageSources().cactus(),(float) k); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/CommandBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.CommandBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(CommandBlock.class) 17 | public abstract class CommandBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/ConduitBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.ConduitBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(ConduitBlock.class) 17 | public abstract class ConduitBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/CrafterBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.CrafterBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(CrafterBlock.class) 17 | public abstract class CrafterBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/DecoratedPotMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.DecoratedPotBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(DecoratedPotBlock.class) 17 | public abstract class DecoratedPotMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/DispenserBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.DispenserBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(DispenserBlock.class) 17 | public abstract class DispenserBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/DoorBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.DoorBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(DoorBlock.class) 17 | public abstract class DoorBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/EnchantingTableBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.EnchantingTableBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(EnchantingTableBlock.class) 17 | public abstract class EnchantingTableBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/HopperBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.HopperBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(HopperBlock.class) 17 | public abstract class HopperBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/PistonBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.PistonBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(PistonBlock.class) 17 | public abstract class PistonBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/PitcherCropBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.PitcherCropBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(PitcherCropBlock.class) 17 | public abstract class PitcherCropBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/ShulkerBoxBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.ShulkerBoxBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(ShulkerBoxBlock.class) 17 | public abstract class ShulkerBoxBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/SmallDripleafBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.SmallDripleafBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(SmallDripleafBlock.class) 17 | public abstract class SmallDripleafBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/StructureBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.StructureBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(StructureBlock.class) 17 | public abstract class StructureBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/TallPlantBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.TallPlantBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(TallPlantBlock.class) 17 | public abstract class TallPlantBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentblockmixin/main/sigleinject/TripwireHookBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentblockmixin.main.sigleinject; 2 | 3 | import net.mafuyu33.mafishmod.mixinhelper.InjectHelper; 4 | import net.minecraft.block.BlockState; 5 | import net.minecraft.block.TripwireHookBlock; 6 | import net.minecraft.entity.LivingEntity; 7 | import net.minecraft.item.ItemStack; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.jetbrains.annotations.Nullable; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(TripwireHookBlock.class) 17 | public abstract class TripwireHookBlockMixin { 18 | @Inject(at = @At("HEAD"), method = "onPlaced")//存储方块的附魔 19 | private void init1(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack, CallbackInfo info) { 20 | InjectHelper.onPlacedInject(world,itemStack,pos); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentitemmixin/AlwaysEnchantableMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentitemmixin; 2 | 3 | import net.mafuyu33.mafishmod.config.ConfigHelper; 4 | import net.minecraft.enchantment.Enchantment; 5 | import net.minecraft.enchantment.EnchantmentTarget; 6 | import net.minecraft.item.ItemStack; 7 | import org.spongepowered.asm.mixin.Final; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.Overwrite; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | 12 | @Mixin(Enchantment.class) 13 | public class AlwaysEnchantableMixin { 14 | 15 | @Final 16 | @Shadow 17 | public EnchantmentTarget target; 18 | 19 | /** 20 | * @author 21 | * Mafuyu33 22 | * @reason 23 | * Always Enchantable. 24 | */ 25 | @Overwrite 26 | public boolean isAcceptableItem(ItemStack stack) { 27 | if(ConfigHelper.isAlwaysEnchantable()) { 28 | return true; 29 | }else { 30 | return this.target.isAcceptableItem(stack.getItem()); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentitemmixin/InfiniteBucketMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentitemmixin; 2 | 3 | import net.minecraft.enchantment.EnchantmentHelper; 4 | import net.minecraft.enchantment.Enchantments; 5 | import net.minecraft.entity.player.PlayerEntity; 6 | import net.minecraft.item.*; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Overwrite; 9 | 10 | public class InfiniteBucketMixin { 11 | @Mixin(BucketItem.class) 12 | public abstract static class InFiniteBucketMixin extends Item implements FluidModificationItem { 13 | public InFiniteBucketMixin(Settings settings) { 14 | super(settings); 15 | } 16 | 17 | /** 18 | * @author 19 | * Mafuyu33 20 | * @reason 21 | * Add infinite bucket 22 | */ 23 | @Overwrite 24 | public static ItemStack getEmptiedStack(ItemStack stack, PlayerEntity player) { 25 | int a = EnchantmentHelper.getLevel(Enchantments.INFINITY, stack);//无限 26 | if (!player.getAbilities().creativeMode & a != 1) { 27 | return new ItemStack(Items.BUCKET); 28 | } else { 29 | return stack; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentitemmixin/slippery/HandledScreenMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentitemmixin.slippery; 2 | 3 | import net.mafuyu33.mafishmod.enchantment.ModEnchantments; 4 | import net.minecraft.client.gui.screen.ingame.HandledScreen; 5 | import net.minecraft.enchantment.EnchantmentHelper; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.screen.slot.Slot; 8 | import org.jetbrains.annotations.Nullable; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 14 | 15 | @Mixin(HandledScreen.class) 16 | public abstract class HandledScreenMixin{ 17 | @Shadow @Nullable 18 | protected Slot focusedSlot; 19 | 20 | @Inject(at = @At(value = "HEAD"), method = "handleHotbarKeyPressed",cancellable = true) 21 | private void init(int keyCode, int scanCode, CallbackInfoReturnable cir){ 22 | Slot slot1 = this.focusedSlot; 23 | if(slot1 != null) { 24 | ItemStack itemStack = slot1.getStack(); 25 | if (EnchantmentHelper.getLevel(ModEnchantments.SLIPPERY, itemStack) > 0) { 26 | cir.cancel(); 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/enchantmentitemmixin/slippery/UnPickUpAbleItemMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.enchantmentitemmixin.slippery; 2 | 3 | import net.mafuyu33.mafishmod.enchantment.ModEnchantments; 4 | import net.minecraft.enchantment.EnchantmentHelper; 5 | import net.minecraft.entity.ItemEntity; 6 | import net.minecraft.item.ItemStack; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | 13 | @Mixin(ItemEntity.class) 14 | public abstract class UnPickUpAbleItemMixin { 15 | @Shadow public abstract void setPickupDelayInfinite(); 16 | 17 | @Shadow public abstract ItemStack getStack(); 18 | 19 | @Inject(at = @At("HEAD"), method = "tick") 20 | private void init(CallbackInfo info) { 21 | // if(EnchantmentHelper.getLevel(ModEnchantments.SLIPPERY,this.getStack())>0) { 22 | // this.setPickupDelayInfinite(); 23 | // } 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/itemmixin/KaoFishMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.itemmixin; 2 | 3 | import net.mafuyu33.mafishmod.item.ModItems; 4 | import net.minecraft.entity.*; 5 | import net.minecraft.fluid.FluidState; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.registry.tag.FluidTags; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.World; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.Shadow; 12 | import org.spongepowered.asm.mixin.Unique; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.Inject; 15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 16 | 17 | @Mixin(ItemEntity.class) 18 | public abstract class KaoFishMixin extends Entity implements Ownable { 19 | 20 | @Unique 21 | private int counter=0; 22 | public KaoFishMixin(EntityType type, World world) { 23 | super(type, world); 24 | } 25 | 26 | @Shadow 27 | public abstract ItemStack getStack(); 28 | 29 | @Inject(at = @At("HEAD"), method = "tick") 30 | private void init(CallbackInfo info) { 31 | World world = this.getWorld(); 32 | BlockPos blockPos = this.getBlockPos(); 33 | FluidState fluidState = world.getFluidState(blockPos); 34 | if (this.getStack().getItem() == ModItems.RUBY && fluidState.isIn(FluidTags.LAVA)) { 35 | counter++; 36 | if(counter>=20) { 37 | System.out.println(123); 38 | dropItem(ModItems.RAW_RUBY); 39 | this.discard(); 40 | counter=0; 41 | } 42 | } 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/itemmixin/NestedBoxMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.itemmixin; 2 | 3 | import net.mafuyu33.mafishmod.config.ConfigHelper; 4 | import net.minecraft.block.Block; 5 | import net.minecraft.block.ShulkerBoxBlock; 6 | import net.minecraft.item.BlockItem; 7 | import net.minecraft.item.Item; 8 | import org.spongepowered.asm.mixin.Final; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Overwrite; 11 | import org.spongepowered.asm.mixin.Shadow; 12 | 13 | 14 | @Mixin(BlockItem.class) 15 | public abstract class NestedBoxMixin extends Item { 16 | 17 | 18 | @Shadow @Final @Deprecated private Block block; 19 | 20 | @Shadow public abstract Block getBlock(); 21 | 22 | public NestedBoxMixin(Settings settings) { 23 | super(settings); 24 | } 25 | 26 | /** 27 | * @author 28 | * Mafuyu33 29 | * @reason 30 | * 让潜影盒能放进潜影盒里 31 | */ 32 | @Overwrite 33 | public boolean canBeNested() { 34 | boolean isNestedBoxInfinite = ConfigHelper.isNestedBoxInfinite(); 35 | if(isNestedBoxInfinite){ 36 | return true; 37 | }else{ 38 | return !(this.block instanceof ShulkerBoxBlock); 39 | } 40 | } 41 | 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/itemmixin/cheesebergerforcat/CatEntityMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.itemmixin.cheesebergerforcat; 2 | 3 | import net.mafuyu33.mafishmod.item.ModItems; 4 | import net.minecraft.entity.EntityType; 5 | import net.minecraft.entity.passive.CatEntity; 6 | import net.minecraft.entity.passive.TameableEntity; 7 | import net.minecraft.recipe.Ingredient; 8 | import net.minecraft.world.World; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 | 14 | @Mixin(CatEntity.class) 15 | public abstract class CatEntityMixin extends TameableEntity { 16 | protected CatEntityMixin(EntityType entityType, World world) { 17 | super(entityType, world); 18 | } 19 | 20 | @Inject(at = @At("HEAD"), method = "initGoals") 21 | private void init(CallbackInfo info) { 22 | this.goalSelector.add(4,new CatEntity.TemptGoal((CatEntity)(Object)this, 0.6, Ingredient.ofItems(ModItems.CHEESE_BERGER), false)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/itemmixin/colliableitem/AbstractBlockMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.itemmixin.colliableitem; 2 | 3 | 4 | import net.minecraft.block.AbstractBlock; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Mutable; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | 12 | @Mixin(AbstractBlock.Settings.class) 13 | public abstract class AbstractBlockMixin { 14 | @Mutable 15 | @Shadow boolean collidable; 16 | @Mutable 17 | @Shadow boolean opaque; 18 | @Mutable 19 | @Shadow boolean dynamicBounds; 20 | @Inject(method = "noCollision", at = @At("HEAD"),cancellable = true) 21 | private void init(CallbackInfoReturnable cir) { 22 | // if(!dynamicBounds) { 23 | dynamicBounds = true; 24 | collidable = true; 25 | opaque = false; 26 | cir.setReturnValue((AbstractBlock.Settings)(Object)this); 27 | // } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/itemmixin/fireworkrocket/FireworkRocketEntityMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.itemmixin.fireworkrocket; 2 | 3 | 4 | import net.mafuyu33.mafishmod.mixinhelper.FireworkRocketEntityMixinHelper; 5 | import net.mafuyu33.mafishmod.config.ConfigHelper; 6 | import net.minecraft.entity.Entity; 7 | import net.minecraft.entity.projectile.FireworkRocketEntity; 8 | import net.minecraft.util.hit.EntityHitResult; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 | 14 | 15 | @Mixin(FireworkRocketEntity.class) 16 | public abstract class FireworkRocketEntityMixin { 17 | @Inject(method = "onEntityHit", at = @At("HEAD")) 18 | private void init(EntityHitResult entityHitResult, CallbackInfo ci) { 19 | boolean isFireworkCanHitOnEntity = ConfigHelper.isFireworkCanHitOnEntity(); 20 | if(isFireworkCanHitOnEntity){ 21 | 22 | Entity entity = entityHitResult.getEntity(); 23 | 24 | FireworkRocketEntityMixinHelper.storeEntityValue(entity.getId(), 5); 25 | 26 | 27 | // FireworkRocketEntityMixinHelper.setEntity(entity);//获取这个实体 28 | // FireworkRocketEntityMixinHelper.setValue(5);//设置循环次数 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/itemmixin/rubystuffrenderer/ItemRendererAccessor.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.itemmixin.rubystuffrenderer; 2 | 3 | 4 | import net.minecraft.client.render.item.ItemModels; 5 | import net.minecraft.client.render.item.ItemRenderer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | @Mixin(ItemRenderer.class) 10 | public interface ItemRendererAccessor { 11 | @Accessor("models") 12 | ItemModels mccourse$getModels(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/itemmixin/rubystuffrenderer/ItemRendererMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.itemmixin.rubystuffrenderer; 2 | 3 | import net.mafuyu33.mafishmod.TutorialMod; 4 | import net.mafuyu33.mafishmod.item.ModItems; 5 | import net.minecraft.client.render.VertexConsumerProvider; 6 | import net.minecraft.client.render.item.ItemRenderer; 7 | import net.minecraft.client.render.model.BakedModel; 8 | import net.minecraft.client.render.model.json.ModelTransformationMode; 9 | import net.minecraft.client.util.ModelIdentifier; 10 | import net.minecraft.client.util.math.MatrixStack; 11 | import net.minecraft.item.ItemStack; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 15 | 16 | @Mixin(ItemRenderer.class) 17 | public abstract class ItemRendererMixin { 18 | @ModifyVariable(method = "renderItem", at = @At(value = "HEAD"), argsOnly = true) 19 | public BakedModel useRubyStaffModel(BakedModel value, ItemStack stack, ModelTransformationMode renderMode, boolean leftHanded, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) { 20 | if (stack.isOf(ModItems.RUBY_STAFF) && renderMode != ModelTransformationMode.GUI) { 21 | return ((ItemRendererAccessor) this).mccourse$getModels().getModelManager().getModel(new ModelIdentifier(TutorialMod.MOD_ID, "ruby_staff_3d", "inventory")); 22 | } 23 | return value; 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/itemmixin/rubystuffrenderer/ModelLoaderMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.itemmixin.rubystuffrenderer; 2 | 3 | import net.mafuyu33.mafishmod.TutorialMod; 4 | import net.minecraft.client.color.block.BlockColors; 5 | import net.minecraft.client.render.model.ModelLoader; 6 | import net.minecraft.client.render.model.json.JsonUnbakedModel; 7 | import net.minecraft.client.util.ModelIdentifier; 8 | import net.minecraft.util.Identifier; 9 | import net.minecraft.util.profiler.Profiler; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.Shadow; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | @Mixin(ModelLoader.class) 20 | public abstract class ModelLoaderMixin { 21 | @Shadow 22 | protected abstract void addModel(ModelIdentifier modelId); 23 | 24 | @Inject(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/ModelLoader;addModel(Lnet/minecraft/client/util/ModelIdentifier;)V", ordinal = 3, shift = At.Shift.AFTER)) 25 | public void addRubyStaff(BlockColors blockColors, Profiler profiler, Map jsonUnbakedModels, Map> blockStates, CallbackInfo ci) { 26 | this.addModel(new ModelIdentifier(TutorialMod.MOD_ID, "ruby_staff_3d", "inventory")); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/itemmixin/swimmingtripwire/PlayerEntityMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.itemmixin.swimmingtripwire; 2 | 3 | 4 | import net.mafuyu33.mafishmod.mixinhelper.TripwireBlockMixinHelper; 5 | import net.mafuyu33.mafishmod.config.ConfigHelper; 6 | import net.minecraft.entity.EntityPose; 7 | import net.minecraft.entity.EntityType; 8 | import net.minecraft.entity.LivingEntity; 9 | import net.minecraft.entity.player.PlayerEntity; 10 | import net.minecraft.world.World; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | 17 | @Mixin(PlayerEntity.class) 18 | public abstract class PlayerEntityMixin extends LivingEntity { 19 | protected PlayerEntityMixin(EntityType entityType, World world) { 20 | super(entityType, world); 21 | 22 | } 23 | @Inject(at = @At("RETURN"), method = "updatePose") 24 | private void init(CallbackInfo ci) { 25 | boolean isSwimTripwire = ConfigHelper.isSwimTripwire(); 26 | if (isSwimTripwire) { 27 | if (TripwireBlockMixinHelper.getEntityValue(this.getId()) > 0) { 28 | EntityPose entityPose3 = EntityPose.SWIMMING; 29 | this.setPose(entityPose3); 30 | TripwireBlockMixinHelper.storeEntityValue(this.getId(), TripwireBlockMixinHelper.getEntityValue(this.getId()) - 1); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/mobmixin/llamaspitforever/LlamaEntityMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.mobmixin.llamaspitforever; 2 | 3 | import net.mafuyu33.mafishmod.config.ConfigHelper; 4 | import net.minecraft.entity.ai.goal.ProjectileAttackGoal; 5 | import net.minecraft.entity.ai.goal.RevengeGoal; 6 | import net.minecraft.entity.mob.PathAwareEntity; 7 | import net.minecraft.entity.passive.LlamaEntity; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 13 | 14 | @Mixin(LlamaEntity.class) 15 | public abstract class LlamaEntityMixin{ 16 | @Inject(at = @At(value = "HEAD"), method = "initGoals") 17 | private void init(CallbackInfo ci) { 18 | boolean isLlamaSpitForever =ConfigHelper.isLlamaSpitForever(); 19 | LlamaEntity self = (LlamaEntity) (Object) this; 20 | if(isLlamaSpitForever) { 21 | self.goalSelector.getGoals().removeIf(goal -> goal.getGoal() instanceof ProjectileAttackGoal); 22 | self.goalSelector.add(3, new ProjectileAttackGoal(self, 1.25, 1, 20.0F)); 23 | }else { 24 | self.goalSelector.getGoals().removeIf(goal -> goal.getGoal() instanceof ProjectileAttackGoal); 25 | self.goalSelector.add(3, new ProjectileAttackGoal(self, 1.25, 40, 20.0F)); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixin/mobmixin/llamaspitforever/LlamaEntity_SpitRevengeGoalMixin.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixin.mobmixin.llamaspitforever; 2 | 3 | import net.mafuyu33.mafishmod.config.ConfigHelper; 4 | import net.minecraft.entity.ai.goal.RevengeGoal; 5 | import net.minecraft.entity.mob.PathAwareEntity; 6 | import net.minecraft.entity.passive.LlamaEntity; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 11 | 12 | @Mixin(LlamaEntity.SpitRevengeGoal.class) 13 | public abstract class LlamaEntity_SpitRevengeGoalMixin extends RevengeGoal { 14 | public LlamaEntity_SpitRevengeGoalMixin(PathAwareEntity mob, Class... noRevengeTypes) { 15 | super(mob, noRevengeTypes); 16 | } 17 | 18 | @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/LlamaEntity;setSpit(Z)V"), method = "shouldContinue",cancellable = true) 19 | private void init(CallbackInfoReturnable cir) { 20 | boolean isLlamaSpitForever =ConfigHelper.isLlamaSpitForever(); 21 | if(isLlamaSpitForever) { 22 | if(target!=null && target.isAlive()) { 23 | cir.setReturnValue(true); 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixinhelper/BowDashMixinHelper.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixinhelper; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class BowDashMixinHelper { 7 | private static boolean isAttackKeyPressed = false; 8 | 9 | // 创建一个静态Map来存储实体ID和值 10 | private static final Map entityValueMap = new HashMap<>(); 11 | 12 | // 在适当的时候将实体ID和值添加到Map中 13 | public static void storeEntityValue(int entityID, int value) { 14 | entityValueMap.put(entityID, value); 15 | } 16 | // 在需要时从Map中检索值 17 | public static int getEntityValue(int entityID) { 18 | return entityValueMap.getOrDefault(entityID, 0); // 默认值为0,如果未找到实体ID 19 | } 20 | 21 | // 创建一个静态Map来存储实体ID和值 22 | private static final Map HitCoolDownMap = new HashMap<>(); 23 | 24 | // 在适当的时候将实体ID和值添加到Map中 25 | public static void storeHitCoolDown(int entityID, int value) { 26 | HitCoolDownMap.put(entityID, value); 27 | } 28 | // 在需要时从Map中检索值 29 | public static int getHitCoolDown(int entityID) { 30 | return HitCoolDownMap.getOrDefault(entityID, 0); // 默认值为0 31 | } 32 | 33 | public static void setIsAttackKeyPressed(boolean isAttackKeyPressed) { 34 | BowDashMixinHelper.isAttackKeyPressed = isAttackKeyPressed; 35 | } 36 | 37 | public static boolean isAttackKeyPressed() { 38 | return isAttackKeyPressed; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixinhelper/ElytraJumpMixinHelper.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixinhelper; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class ElytraJumpMixinHelper { 7 | private static boolean isJumpKeyPressed = false; 8 | 9 | // 创建一个静态Map来存储实体ID和值 10 | private static final Map entityValueMap = new HashMap<>(); 11 | 12 | // 在适当的时候将实体ID和值添加到Map中 13 | public static void storeEntityValue(int entityID, int value) { 14 | entityValueMap.put(entityID, value); 15 | } 16 | // 在需要时从Map中检索值 17 | public static int getEntityValue(int entityID) { 18 | return entityValueMap.getOrDefault(entityID, 0); // 默认值为0,如果未找到实体ID 19 | } 20 | // 21 | // // 创建一个静态Map来存储实体ID和值 22 | // private static final Map HitCoolDownMap = new HashMap<>(); 23 | // 24 | // // 在适当的时候将实体ID和值添加到Map中 25 | // public static void storeHitCoolDown(int entityID, int value) { 26 | // HitCoolDownMap.put(entityID, value); 27 | // } 28 | // // 在需要时从Map中检索值 29 | // public static int getHitCoolDown(int entityID) { 30 | // return HitCoolDownMap.getOrDefault(entityID, 0); // 默认值为0 31 | // } 32 | 33 | public static void setIsJumpKeyPressed(boolean isJumpKeyPressed) { 34 | ElytraJumpMixinHelper.isJumpKeyPressed = isJumpKeyPressed; 35 | } 36 | 37 | public static boolean isJumpKeyPressed() { 38 | return isJumpKeyPressed; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixinhelper/FearMixinHelper.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixinhelper; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | import java.util.UUID; 6 | 7 | public class FearMixinHelper { 8 | // 创建一个静态Map来存储实体ID和值 9 | private static final Map entityValueMap = new HashMap<>(); 10 | 11 | // 在适当的时候将实体ID和值添加到Map中 12 | public static void storeEntityValue(UUID entityID, int value) { 13 | entityValueMap.put(entityID, value); 14 | } 15 | // 在需要时从Map中检索值 16 | public static int getEntityValue(UUID entityID) { 17 | return entityValueMap.getOrDefault(entityID, 0); // 默认值为0,如果未找到实体ID 18 | } 19 | // 创建一个静态Map来存储实体ID和值 20 | private static final Map isAttackedMap = new HashMap<>(); 21 | 22 | // 在适当的时候将实体ID和值添加到Map中 23 | public static void storeIsAttacked(UUID entityID, Boolean value) { 24 | isAttackedMap.put(entityID, value); 25 | } 26 | // 在需要时从Map中检索值 27 | public static Boolean getIsAttacked(UUID entityID) { 28 | return isAttackedMap.getOrDefault(entityID, false); // 默认值为0,如果未找到实体ID 29 | } 30 | 31 | // 创建一个静态Map来存储实体ID和值 32 | private static final Map isFirstTimeMap = new HashMap<>(); 33 | 34 | // 在适当的时候将实体ID和值添加到Map中 35 | public static void setIsFirstTime(UUID entityID, Boolean value) { 36 | isFirstTimeMap.put(entityID, value); 37 | } 38 | // 在需要时从Map中检索值 39 | public static Boolean getIsFirstTime(UUID entityID) { 40 | return isFirstTimeMap.getOrDefault(entityID, true); // 默认值为0,如果未找到实体ID 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixinhelper/FireworkRocketEntityMixinHelper.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixinhelper; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class FireworkRocketEntityMixinHelper { 7 | 8 | 9 | // 创建一个静态Map来存储实体UUID和值 10 | private static final Map entityValueMap = new HashMap<>(); 11 | 12 | // 在适当的时候将实体UUID和值添加到Map中 13 | public static void storeEntityValue(int entityID, int value) { 14 | entityValueMap.put(entityID, value); 15 | } 16 | // 在需要时从Map中检索值 17 | public static int getEntityValue(int entityID) { 18 | return entityValueMap.getOrDefault(entityID, 0); // 默认值为0,如果未找到实体UUID 19 | } 20 | 21 | 22 | // 23 | // private static int value = 0; // 初始化值为0 24 | // private static Entity entity = null; // 初始化Entity为null 25 | // 26 | // public static void setValue(int newValue) { 27 | // value = newValue; 28 | // } 29 | // 30 | // public static int getValue() { 31 | // return value; 32 | // } 33 | // 34 | // public static void setEntity(Entity newEntity) { 35 | // entity = newEntity; 36 | // } 37 | // 38 | // public static Entity getEntity() { 39 | // return entity; 40 | // } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixinhelper/InjectHelper.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixinhelper; 2 | 3 | 4 | import net.mafuyu33.mafishmod.enchantmentblock.BlockEnchantmentStorage; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.nbt.NbtList; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | 10 | 11 | import java.util.Objects; 12 | 13 | public class InjectHelper { 14 | 15 | public static void onPlacedInject(World world, ItemStack itemStack, BlockPos pos) { 16 | if (!world.isClient) {//只在服务端运行 17 | if (!Objects.equals(itemStack.getEnchantments(), new NbtList())) {//如果方块有附魔 18 | NbtList enchantments = itemStack.getEnchantments(); //获取物品栈上的附魔信息列表 19 | BlockEnchantmentStorage.addBlockEnchantment(pos.toImmutable(), enchantments);//储存信息 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixinhelper/MathQuestionMixinHelper.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixinhelper; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class MathQuestionMixinHelper { 7 | // 创建一个静态Map来存储实体ID和值 8 | private static final Map entityValueMap = new HashMap<>(); 9 | 10 | // 在适当的时候将实体ID和值添加到Map中 11 | public static void storeEntityValue(int entityID, int value) { 12 | entityValueMap.put(entityID, value); 13 | } 14 | // 在需要时从Map中检索值 15 | public static int getEntityValue(int entityID) { 16 | return entityValueMap.getOrDefault(entityID, 0); // 默认值为0,如果未找到实体ID 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixinhelper/MixinHelperManager.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixinhelper; 2 | 3 | import net.minecraft.entity.Entity; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | 7 | import java.util.Map; 8 | import java.util.WeakHashMap; 9 | 10 | public class MixinHelperManager { 11 | private static final Logger LOGGER = LoggerFactory.getLogger(MixinHelperManager.class); 12 | private static final Map helpers = new WeakHashMap<>(); 13 | 14 | public static FireworkRocketEntityMixinHelper getHelperForEntity(Entity entity) { 15 | FireworkRocketEntityMixinHelper helper = helpers.computeIfAbsent(entity, e -> new FireworkRocketEntityMixinHelper()); 16 | LOGGER.info("Getting helper for entity: {} | Helper: {}", entity, helper); 17 | return helper; 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixinhelper/ShieldDashMixinHelper.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixinhelper; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class ShieldDashMixinHelper { 7 | private static boolean isAttackKeyPressed = false; 8 | 9 | // 创建一个静态Map来存储实体ID和值 10 | private static final Map entityValueMap = new HashMap<>(); 11 | 12 | // 在适当的时候将实体ID和值添加到Map中 13 | public static void storeEntityValue(int entityID, int value) { 14 | entityValueMap.put(entityID, value); 15 | } 16 | // 在需要时从Map中检索值 17 | public static int getEntityValue(int entityID) { 18 | return entityValueMap.getOrDefault(entityID, 0); // 默认值为0,如果未找到实体ID 19 | } 20 | 21 | // 创建一个静态Map来存储实体ID和值 22 | private static final Map HitCoolDownMap = new HashMap<>(); 23 | 24 | // 在适当的时候将实体ID和值添加到Map中 25 | public static void storeHitCoolDown(int entityID, int value) { 26 | HitCoolDownMap.put(entityID, value); 27 | } 28 | // 在需要时从Map中检索值 29 | public static int getHitCoolDown(int entityID) { 30 | return HitCoolDownMap.getOrDefault(entityID, 0); // 默认值为0 31 | } 32 | 33 | public static void setIsAttackKeyPressed(boolean isAttackKeyPressed) { 34 | ShieldDashMixinHelper.isAttackKeyPressed = isAttackKeyPressed; 35 | } 36 | 37 | public static boolean isAttackKeyPressed() { 38 | return isAttackKeyPressed; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixinhelper/TripwireBlockMixinHelper.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixinhelper; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class TripwireBlockMixinHelper { 7 | 8 | // 创建一个静态Map来存储实体UUID和值 9 | private static final Map entityValueMap = new HashMap<>(); 10 | 11 | // 在适当的时候将实体UUID和值添加到Map中 12 | public static void storeEntityValue(int entityID, int value) { 13 | entityValueMap.put(entityID, value); 14 | } 15 | // 在需要时从Map中检索值 16 | public static int getEntityValue(int entityID) { 17 | return entityValueMap.getOrDefault(entityID, 0); // 默认值为0,如果未找到实体UUID 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixinhelper/VrRubberItemHelper.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixinhelper; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class VrRubberItemHelper { 7 | // 创建一个静态Map来存储实体ID和值 8 | private static final Map entityValueMap = new HashMap<>(); 9 | 10 | // 在适当的时候将实体ID和值添加到Map中 11 | public static void storeEntityValue(int entityID, int value) { 12 | entityValueMap.put(entityID, value); 13 | } 14 | // 在需要时从Map中检索值 15 | public static int getEntityValue(int entityID) { 16 | return entityValueMap.getOrDefault(entityID, 0); // 默认值为0,如果未找到实体ID 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/mixinhelper/WeaponEnchantmentMixinHelper.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.mixinhelper; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | import java.util.UUID; 6 | 7 | public class WeaponEnchantmentMixinHelper { 8 | 9 | // 创建一个静态 Map 来存储实体 UUID 和值 10 | private static final Map reverseMap = new HashMap<>(); 11 | 12 | // 在适当的时候将实体 UUID 和值添加到 Map 中 13 | public static void storeReverse(UUID entityUUID, int value) { 14 | reverseMap.put(entityUUID, value); 15 | } 16 | 17 | // 在需要时从 Map 中检索值 18 | public static int getReverse(UUID entityUUID) { 19 | return reverseMap.getOrDefault(entityUUID, 0); // 默认值为0,如果未找到实体 UUID 20 | } 21 | 22 | // 创建一个静态Map来存储实体UUID和值 23 | private static final Map entityValueMap = new HashMap<>(); 24 | 25 | // 在适当的时候将实体UUID和值添加到Map中 26 | public static void storeEntityValue(int entityID, int value) { 27 | entityValueMap.put(entityID, value); 28 | } 29 | // 在需要时从Map中检索值 30 | public static int getEntityValue(int entityID) { 31 | return entityValueMap.getOrDefault(entityID, 0); // 默认值为0,如果未找到实体UUID 32 | } 33 | 34 | 35 | // 36 | // private static int value = 0; // 初始化值为0 37 | // private static Entity entity = null; // 初始化Entity为null 38 | // 39 | // public static void setValue(int newValue) { 40 | // value = newValue; 41 | // } 42 | // 43 | // public static int getValue() { 44 | // return value; 45 | // } 46 | // 47 | // public static void setEntity(Entity newEntity) { 48 | // entity = newEntity; 49 | // } 50 | // 51 | // public static Entity getEntity() { 52 | // return entity; 53 | // } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/networking/packet/C2S/BowDashC2SPacket.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.networking.packet.C2S; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 4 | import net.mafuyu33.mafishmod.mixinhelper.BowDashMixinHelper; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraft.server.network.ServerPlayNetworkHandler; 8 | import net.minecraft.server.network.ServerPlayerEntity; 9 | 10 | public class BowDashC2SPacket { 11 | public static void receive(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, 12 | PacketByteBuf buf, PacketSender responseSender) { 13 | BowDashMixinHelper.storeHitCoolDown(player.getId(),buf.getInt(0)); 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/networking/packet/C2S/ExampleC2SPacket.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.networking.packet.C2S; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 4 | import net.minecraft.nbt.NbtCompound; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraft.server.network.ServerPlayNetworkHandler; 8 | import net.minecraft.server.network.ServerPlayerEntity; 9 | import net.minecraft.world.GameMode; 10 | 11 | public class ExampleC2SPacket { 12 | public static void receive(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, 13 | PacketByteBuf buf, PacketSender responseSender) { 14 | // Everything here happens ONLY on the Server! 15 | // Do whatever processing you need here, then send a packet to the client to inform them of the game mode change. 16 | NbtCompound nbt = new NbtCompound(); 17 | nbt.putInt("playerGameType", GameMode.SPECTATOR.ordinal()); // 设置玩家游戏模式为观察者模式 18 | player.setGameMode(nbt); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/networking/packet/C2S/FuC2SPacket.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.networking.packet.C2S; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 4 | import net.minecraft.entity.Entity; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.nbt.NbtCompound; 7 | import net.minecraft.network.PacketByteBuf; 8 | import net.minecraft.server.MinecraftServer; 9 | import net.minecraft.server.network.ServerPlayNetworkHandler; 10 | import net.minecraft.server.network.ServerPlayerEntity; 11 | import net.minecraft.util.math.Vec3d; 12 | import net.minecraft.world.GameMode; 13 | 14 | import java.util.UUID; 15 | 16 | public class FuC2SPacket { 17 | static Vec3d direction; 18 | static UUID uuid; 19 | public static void receive(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, 20 | PacketByteBuf buf, PacketSender responseSender) { 21 | // Everything here happens ONLY on the Server! 22 | // Do whatever processing you need here, then send a packet to the client to inform them of the game mode change. 23 | int flag = buf.readInt(); 24 | if(flag==1) { 25 | direction = buf.readVec3d(); 26 | }else if(flag==2) { 27 | uuid = buf.readUuid(); 28 | } 29 | // itemStack.addVelocity(direction.x * horizontalSpeed, 0.3, direction.z * horizontalSpeed); 30 | } 31 | public static Vec3d getDirection(){ 32 | return direction; 33 | } 34 | public static UUID getUuid(){ 35 | if(uuid == null){ 36 | return null; 37 | }else { 38 | return uuid; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/networking/packet/C2S/GameOptionsC2SPacket.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.networking.packet.C2S; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 4 | import net.minecraft.client.option.GameOptions; 5 | import net.minecraft.nbt.NbtCompound; 6 | import net.minecraft.network.PacketByteBuf; 7 | import net.minecraft.server.MinecraftServer; 8 | import net.minecraft.server.network.ServerPlayNetworkHandler; 9 | import net.minecraft.server.network.ServerPlayerEntity; 10 | import net.minecraft.world.GameMode; 11 | 12 | public class GameOptionsC2SPacket { 13 | public static float blocks; 14 | public static float master; 15 | public static void receive(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, 16 | PacketByteBuf buf, PacketSender responseSender) { 17 | blocks = buf.readFloat(); 18 | master = buf.readFloat(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/networking/packet/C2S/SheepBreedingC2SPacket.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.networking.packet.C2S; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 4 | import net.minecraft.nbt.NbtCompound; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraft.server.network.ServerPlayNetworkHandler; 8 | import net.minecraft.server.network.ServerPlayerEntity; 9 | import net.minecraft.world.GameMode; 10 | 11 | public class SheepBreedingC2SPacket { 12 | static int times; 13 | public static void receive(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, 14 | PacketByteBuf buf, PacketSender responseSender) { 15 | times = buf.readInt(); 16 | } 17 | public static int getTimes(){ 18 | return times; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/networking/packet/C2S/ShieldDashC2SPacket.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.networking.packet.C2S; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 4 | import net.mafuyu33.mafishmod.mixinhelper.ShieldDashMixinHelper; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraft.server.network.ServerPlayNetworkHandler; 8 | import net.minecraft.server.network.ServerPlayerEntity; 9 | 10 | public class ShieldDashC2SPacket { 11 | public static void receive(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, 12 | PacketByteBuf buf, PacketSender responseSender) { 13 | ShieldDashMixinHelper.storeHitCoolDown(player.getId(),buf.getInt(0)); 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/networking/packet/C2S/ThrowPowerC2SPacket.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.networking.packet.C2S; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 4 | import net.minecraft.nbt.NbtCompound; 5 | import net.minecraft.network.PacketByteBuf; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraft.server.network.ServerPlayNetworkHandler; 8 | import net.minecraft.server.network.ServerPlayerEntity; 9 | import net.minecraft.world.GameMode; 10 | 11 | public class ThrowPowerC2SPacket { 12 | public static float throw_power; 13 | public static void receive(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, 14 | PacketByteBuf buf, PacketSender responseSender) { 15 | throw_power = buf.readFloat(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/networking/packet/S2C/BellSoundS2CPacket.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.networking.packet.S2C; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 4 | import net.minecraft.client.MinecraftClient; 5 | import net.minecraft.client.network.ClientPlayNetworkHandler; 6 | import net.minecraft.client.sound.Sound; 7 | import net.minecraft.nbt.NbtCompound; 8 | import net.minecraft.network.PacketByteBuf; 9 | import net.minecraft.sound.SoundCategory; 10 | import net.minecraft.sound.SoundEvents; 11 | import net.minecraft.util.math.BlockPos; 12 | import net.minecraft.world.GameMode; 13 | 14 | public class BellSoundS2CPacket { 15 | public static void receive(MinecraftClient client, ClientPlayNetworkHandler handler, 16 | PacketByteBuf buf, PacketSender responseSender) { 17 | // Everything here happens ONLY on the Client! 18 | int i=buf.readInt(); 19 | BlockPos blockPos = buf.readBlockPos(); 20 | System.out.println("收到!"); 21 | System.out.println(i); 22 | System.out.println(blockPos); 23 | if(i==1 && client.world!=null){ 24 | System.out.println("播放!"); 25 | client.world.playSound(client.player, blockPos, SoundEvents.BLOCK_BELL_USE, SoundCategory.BLOCKS); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/networking/packet/S2C/ExampleS2CPacket.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.networking.packet.S2C; 2 | 3 | import net.fabricmc.fabric.api.networking.v1.PacketSender; 4 | import net.minecraft.client.MinecraftClient; 5 | import net.minecraft.client.network.ClientPlayNetworkHandler; 6 | import net.minecraft.nbt.NbtCompound; 7 | import net.minecraft.network.PacketByteBuf; 8 | import net.minecraft.server.MinecraftServer; 9 | import net.minecraft.server.network.ServerPlayNetworkHandler; 10 | import net.minecraft.server.network.ServerPlayerEntity; 11 | import net.minecraft.world.GameMode; 12 | 13 | public class ExampleS2CPacket { 14 | public static void receive(MinecraftClient client, ClientPlayNetworkHandler handler, 15 | PacketByteBuf buf, PacketSender responseSender) { 16 | // Everything here happens ONLY on the Client! 17 | NbtCompound nbt = new NbtCompound(); 18 | nbt.putInt("playerGameType", GameMode.SPECTATOR.ordinal()); // 设置玩家游戏模式为观察者模式 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/particle/ModParticles.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.particle; 2 | 3 | import net.fabricmc.fabric.api.particle.v1.FabricParticleTypes; 4 | import net.mafuyu33.mafishmod.TutorialMod; 5 | import net.minecraft.particle.DefaultParticleType; 6 | import net.minecraft.registry.Registries; 7 | import net.minecraft.registry.Registry; 8 | import net.minecraft.util.Identifier; 9 | 10 | public class ModParticles { 11 | public static final DefaultParticleType CITRINE_PARTICLE = FabricParticleTypes.simple(); 12 | public static final DefaultParticleType RUBBER_PARTICLE = FabricParticleTypes.simple(); 13 | public static final DefaultParticleType KNOCK_BACK_PARTICLE = FabricParticleTypes.simple(); 14 | 15 | public static void registerParticles() { 16 | Registry.register(Registries.PARTICLE_TYPE, 17 | new Identifier(TutorialMod.MOD_ID, "citrine_particle"), CITRINE_PARTICLE); 18 | Registry.register(Registries.PARTICLE_TYPE, 19 | new Identifier(TutorialMod.MOD_ID, "rubber_particle"), RUBBER_PARTICLE); 20 | Registry.register(Registries.PARTICLE_TYPE, 21 | new Identifier(TutorialMod.MOD_ID, "knock_back_particle"), KNOCK_BACK_PARTICLE); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/particle/ParticleStorage.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.particle; 2 | 3 | import io.netty.buffer.Unpooled; 4 | import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; 5 | import net.mafuyu33.mafishmod.networking.ModMessages; 6 | import net.mafuyu33.mafishmod.networking.packet.C2S.ParticleDataC2SPacket; 7 | import net.minecraft.network.PacketByteBuf; 8 | import net.minecraft.util.math.Vec3d; 9 | 10 | import java.util.*; 11 | 12 | 13 | public class ParticleStorage{//储存粒子和移除粒子的方法 14 | public static void addParticle(Vec3d position, double red, double green, double blue) { 15 | UUID id = UUID.randomUUID(); 16 | sendParticleData(position,new double[]{red, green, blue},id,true); 17 | } 18 | 19 | public static void sendParticleData(Vec3d position, double[] color, UUID uuid, boolean addOrRemove) { 20 | PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer()); 21 | ParticleDataC2SPacket.encodeAdd(buf, position, color, uuid, addOrRemove); 22 | ClientPlayNetworking.send(ModMessages.PARTICLE_DATA_ID, buf); 23 | } 24 | 25 | public static void removeParticleData(Vec3d position){ 26 | PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer()); 27 | ParticleDataC2SPacket.encodeRemove(buf, position,false); 28 | ClientPlayNetworking.send(ModMessages.PARTICLE_DATA_ID, buf); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/render/CustomParticleRenderer.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.render; 2 | 3 | import net.minecraft.client.MinecraftClient; 4 | import net.minecraft.client.world.ClientWorld; 5 | import net.minecraft.particle.ParticleEffect; 6 | import net.minecraft.particle.ParticleTypes; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.util.math.Vec3d; 9 | 10 | public class CustomParticleRenderer { 11 | public static void spawnFlameParticles(Vec3d pos) { 12 | MinecraftClient client = MinecraftClient.getInstance(); 13 | ClientWorld world = client.world; 14 | if (world != null) { 15 | ParticleEffect flameParticle = ParticleTypes.FLAME; 16 | BlockPos blockPos = new BlockPos((int) pos.x, (int)pos.y, (int)pos.z); 17 | // 添加火焰粒子到世界 18 | world.addParticle(flameParticle, blockPos.getX() + 0.5, blockPos.getY() + 0.5, blockPos.getZ() + 0.5, 0.0, 0.0, 0.0); 19 | System.out.println(123); 20 | } 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/screen/ModScreenHandlers.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.screen; 2 | 3 | import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType; 4 | 5 | import net.mafuyu33.mafishmod.TutorialMod; 6 | import net.minecraft.registry.Registries; 7 | import net.minecraft.registry.Registry; 8 | import net.minecraft.screen.ScreenHandlerType; 9 | import net.minecraft.util.Identifier; 10 | 11 | public class ModScreenHandlers { 12 | public static final ScreenHandlerType GEM_POLISHING_SCREEN_HANDLER = 13 | Registry.register(Registries.SCREEN_HANDLER, new Identifier(TutorialMod.MOD_ID, "gem_polishing"), 14 | new ExtendedScreenHandlerType<>(GemPolishingScreenHandler::new)); 15 | 16 | public static void registerScreenHandlers() { 17 | TutorialMod.LOGGER.info("Registering Screen Handlers for " + TutorialMod.MOD_ID); 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/util/ModCustomTrades.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.util; 2 | 3 | import net.fabricmc.fabric.api.object.builder.v1.trade.TradeOfferHelper; 4 | import net.mafuyu33.mafishmod.block.ModBlocks; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.item.Items; 7 | import net.minecraft.village.TradeOffer; 8 | import net.minecraft.village.VillagerProfession; 9 | 10 | public class ModCustomTrades { 11 | public static void registerCustomTrades() { 12 | TradeOfferHelper.registerVillagerOffers(VillagerProfession.FARMER, 1, 13 | factories -> { 14 | factories.add((entity, random) -> new TradeOffer( 15 | new ItemStack(Items.EMERALD, 30), 16 | new ItemStack(ModBlocks.GOLD_MELON, 1), 17 | 6, 5, 0.05f)); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/net/mafuyu33/mafishmod/util/ModTags.java: -------------------------------------------------------------------------------- 1 | package net.mafuyu33.mafishmod.util; 2 | 3 | import net.mafuyu33.mafishmod.TutorialMod; 4 | import net.minecraft.block.Block; 5 | import net.minecraft.item.Item; 6 | import net.minecraft.registry.RegistryKeys; 7 | import net.minecraft.registry.tag.TagKey; 8 | import net.minecraft.util.Identifier; 9 | 10 | public class ModTags { 11 | public static class Blocks { 12 | public static final TagKey METAL_DETECTOR_DETECTABLE_BLOCKS = 13 | createTag("metal_detector_detectable_blocks"); 14 | 15 | private static TagKey createTag(String name){ 16 | return TagKey.of(RegistryKeys.BLOCK,new Identifier(TutorialMod.MOD_ID,name)); 17 | } 18 | } 19 | 20 | public static class Items { 21 | public static final TagKey MOD_ARROW_ITEMS = 22 | createTag("mod_arrow_items"); 23 | private static TagKey createTag(String name){ 24 | return TagKey.of(RegistryKeys.ITEM,new Identifier(TutorialMod.MOD_ID,name)); 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/blockstates/gem_polishing_station.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "mafishmod:block/gem_polishing_station" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/blockstates/gold_melon.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "mafishmod:block/gold_melon" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/blockstates/potato_tnt.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "type=bottom": { 4 | "model": "mafishmod:block/potato_tnt" 5 | }, 6 | "type=double": { 7 | "model": "mafishmod:block/potato_tnt" 8 | }, 9 | "type=top": { 10 | "model": "mafishmod:block/potato_tnt" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/blockstates/potato_tnt_prepare.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "mafishmod:block/potato_tnt_prepare" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/blockstates/raw_ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "mafishmod:block/raw_ruby_block" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/blockstates/ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "mafishmod:block/ruby_block" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/blockstates/white_cat_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "": { 4 | "model": "mafishmod:block/white_cat_block" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/icon.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/block/gold_melon.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube_column", 3 | "textures": { 4 | "end": "mafishmod:block/gold_melon_top", 5 | "side": "mafishmod:block/gold_melon_side" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/block/potato_tnt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/slab", 3 | "textures": { 4 | "bottom": "mafishmod:block/potato_tnt", 5 | "side": "mafishmod:block/potato_tnt", 6 | "top": "mafishmod:block/potato_tnt" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/block/potato_tnt_prepare.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cross", 3 | "textures": { 4 | "cross": "mafishmod:block/potato_tnt_prepare" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/block/raw_ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube_all", 3 | "textures": { 4 | "all": "mafishmod:block/raw_ruby_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/block/ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube_all", 3 | "textures": { 4 | "all": "mafishmod:block/ruby_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/block/white_cat_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "block/cube_all", 3 | "textures": { 4 | "all": "mafishmod:block/white_cat_block" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/apple_vision_pro.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/apple_vision_pro" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/bread_sword.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/bread_sword" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/bread_sword_hot.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/bread_sword_hot" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/bread_sword_very_hot.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/bread_sword_very_hot" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/cheese_berger.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/cheese_berger" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/coal_briquette.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/coal_briquette" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/colliable.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/colliable" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/cool_glass.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/cool_glass" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/cool_glass2.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/cool_glass2" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/firework_arrow.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/firework_arrow" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/fu.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/fu" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/gem_polishing_station.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "mafishmod:block/gem_polishing_station" 3 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/gold_melon.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "mafishmod:block/gold_melon" 3 | } 4 | -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/iron_fake.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/iron_fake" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/iron_golem_item.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/iron_golem_item" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/lightning_ball.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/lightning_ball" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/math_sword.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/math_sword" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/metal_detector.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/metal_detector" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/milk_flesh.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/milk_flesh" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/poison_sword.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/poison_sword" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/potato_tnt.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/potato_tnt" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/potato_tnt_prepare.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/potato_tnt" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/raw_ruby.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/raw_ruby" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/raw_ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "mafishmod:block/raw_ruby_block" 3 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/rtx4090.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/rtx4090" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/rtx4090pickaxe.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/rtx4090pickaxe" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/ruby.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/ruby" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "mafishmod:block/ruby_block" 3 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/ruby_staff.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/ruby_staff" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/stargazy_pie.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/stargazy_pie" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/stone_ball.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/stone_ball" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/switch.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/switch" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/time_stop.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/time_stop" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/tnt_ball.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/tnt_ball" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/tomato.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/tomato" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/villager_item.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/villager_item" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/vr_compasses.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/vr_compasses" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/vr_magic.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/vr_magic" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/vr_pen.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/vr_pen" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/vr_rubber.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/vr_rubber" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/vr_ruler.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "item/generated", 3 | "textures": { 4 | "layer0": "mafishmod:item/vr_ruler" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/white_cat_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "mafishmod:block/white_cat_block" 3 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/zhuge_arrow.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "mafishmod:item/zhuge", 3 | "textures": { 4 | "layer0": "mafishmod:item/zhuge_arrow" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/zhuge_firework.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "mafishmod:item/zhuge", 3 | "textures": { 4 | "layer0": "mafishmod:item/zhuge_firework" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/zhuge_pulling_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "mafishmod:item/zhuge", 3 | "textures": { 4 | "layer0": "mafishmod:item/zhuge_pulling_0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/zhuge_pulling_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "mafishmod:item/zhuge", 3 | "textures": { 4 | "layer0": "mafishmod:item/zhuge_pulling_1" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/models/item/zhuge_pulling_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "mafishmod:item/zhuge", 3 | "textures": { 4 | "layer0": "mafishmod:item/zhuge_pulling_2" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/particles/citrine_particle.json: -------------------------------------------------------------------------------- 1 | { 2 | "textures": [ 3 | "mafishmod:citrine" 4 | ] 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/particles/rubber_particle.json: -------------------------------------------------------------------------------- 1 | { 2 | "textures": [ 3 | "mafishmod:rubber" 4 | ] 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/cheese_berger_cat.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/cheese_berger_cat.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/cheese_berger_man.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/cheese_berger_man.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/dash_sound.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/dash_sound.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/metal_detector_found_ore.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/metal_detector_found_ore.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/never1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/never1.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/never10.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/never10.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/never2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/never2.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/never3.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/never3.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/never4.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/never4.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/never5.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/never5.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/never6.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/never6.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/never7.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/never7.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/never8.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/never8.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/never9.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/never9.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/pin.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/pin.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/sound_block_break.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/sound_block_break.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/sound_block_fall.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/sound_block_fall.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/sound_block_hit.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/sound_block_hit.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/sound_block_place.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/sound_block_place.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/sounds/sound_block_step.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/sounds/sound_block_step.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/block/gem_polishing_station_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/block/gem_polishing_station_texture.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/block/gold_melon_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/block/gold_melon_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/block/gold_melon_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/block/gold_melon_top.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/block/potato_tnt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/block/potato_tnt.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/block/potato_tnt_prepare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/block/potato_tnt_prepare.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/block/raw_ruby_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/block/raw_ruby_block.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/block/ruby_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/block/ruby_block.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/block/white_cat_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/block/white_cat_block.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/entity/villager/profession/sound_master.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/entity/villager/profession/sound_master.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/gui/a_leaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/gui/a_leaf.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/gui/gem_polishing_station_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/gui/gem_polishing_station_gui.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/apple_vision_pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/apple_vision_pro.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/bread_sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/bread_sword.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/bread_sword_hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/bread_sword_hot.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/bread_sword_very_hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/bread_sword_very_hot.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/cheese_berger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/cheese_berger.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/coal_briquette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/coal_briquette.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/colliable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/colliable.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/cool_glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/cool_glass.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/cool_glass2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/cool_glass2.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/firework_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/firework_arrow.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/fu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/fu.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/iron_fake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/iron_fake.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/iron_golem_item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/iron_golem_item.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/lightning_ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/lightning_ball.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/math_sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/math_sword.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/metal_detector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/metal_detector.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/milk_flesh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/milk_flesh.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/poison_sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/poison_sword.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/potato_tnt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/potato_tnt.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/raw_ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/raw_ruby.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/rtx4090.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/rtx4090.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/ruby.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/ruby_boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/ruby_boots.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/ruby_chestplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/ruby_chestplate.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/ruby_helmet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/ruby_helmet.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/ruby_leggings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/ruby_leggings.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/ruby_pickaxe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/ruby_pickaxe.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/ruby_staff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/ruby_staff.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/ruby_staff_3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/ruby_staff_3d.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/stargazy_pie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/stargazy_pie.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/stone_ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/stone_ball.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/switch.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/time_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/time_stop.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/tnt_ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/tnt_ball.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/tomato.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/tomato.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/villager_item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/villager_item.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/vr_compasses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/vr_compasses.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/vr_magic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/vr_magic.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/vr_pen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/vr_pen.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/vr_rubber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/vr_rubber.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/vr_ruler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/vr_ruler.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/zhuge_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/zhuge_arrow.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/zhuge_firework.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/zhuge_firework.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/zhuge_pulling_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/zhuge_pulling_0.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/zhuge_pulling_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/zhuge_pulling_1.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/zhuge_pulling_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/zhuge_pulling_2.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/item/zhuge_standby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/item/zhuge_standby.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/mob_effect/antidote_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/mob_effect/antidote_effect.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/mob_effect/flower_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/mob_effect/flower_effect.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/mob_effect/ironman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/mob_effect/ironman.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/mob_effect/sheep_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/mob_effect/sheep_effect.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/mob_effect/spider_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/mob_effect/spider_effect.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/mob_effect/teleport_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/mob_effect/teleport_effect.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/models/armor/ruby_layer_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/models/armor/ruby_layer_1.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/models/armor/ruby_layer_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/models/armor/ruby_layer_2.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/particle/citrine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/particle/citrine.png -------------------------------------------------------------------------------- /src/main/resources/assets/mafishmod/textures/particle/rubber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mafuyu33/mafishmod/0cdeea6b9574d9e4f21746281927f505944443ed/src/main/resources/assets/mafishmod/textures/particle/rubber.png -------------------------------------------------------------------------------- /src/main/resources/data/fabric/tags/blocks/needs_tool_level_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "mafishmod:ruby_block" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/main/resources/data/minecraft/tags/blocks/mineable/axes.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | 5 | ] 6 | } -------------------------------------------------------------------------------- /src/main/resources/data/minecraft/tags/blocks/mineable/hoe.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | 5 | ] 6 | } -------------------------------------------------------------------------------- /src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "mafishmod:ruby_block", 5 | "mafishmod:raw_ruby_block", 6 | "mafishmod:white_cat_block", 7 | "mafishmod:gold_melon" 8 | ] 9 | } -------------------------------------------------------------------------------- /src/main/resources/data/minecraft/tags/blocks/mineable/shovel.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | 5 | ] 6 | } -------------------------------------------------------------------------------- /src/main/resources/data/minecraft/tags/blocks/needs_diamond_tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | 5 | ] 6 | } -------------------------------------------------------------------------------- /src/main/resources/data/minecraft/tags/blocks/needs_iron_tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "mafishmod:raw_ruby_block" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/main/resources/data/minecraft/tags/blocks/needs_stone_tool.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "mafishmod:ruby_block" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/main/resources/data/minecraft/tags/items/arrows.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "mafishmod:firework_arrow" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/loot_tables/blocks/gold_melon.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "mafishmod:gold_melon" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/loot_tables/blocks/raw_ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "mafishmod:raw_ruby_block" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/loot_tables/blocks/ruby_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "mafishmod:ruby_block" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/loot_tables/blocks/white_cat_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:block", 3 | "pools": [ 4 | { 5 | "bonus_rolls": 0.0, 6 | "conditions": [ 7 | { 8 | "condition": "minecraft:survives_explosion" 9 | } 10 | ], 11 | "entries": [ 12 | { 13 | "type": "minecraft:item", 14 | "name": "mafishmod:white_cat_block" 15 | } 16 | ], 17 | "rolls": 1.0 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/apple_vision_pro.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "category": "misc", 4 | "ingredients": [ 5 | { 6 | "item": "minecraft:apple" 7 | }, 8 | { 9 | "item": "minecraft:spyglass" 10 | }, 11 | { 12 | "item": "mafishmod:cool_glass" 13 | } 14 | ], 15 | "result": { 16 | "item": "mafishmod:apple_vision_pro" 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/bread_sword.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "pattern": [ 5 | "$", 6 | "$", 7 | "#" 8 | ], 9 | "key": { 10 | "#": { 11 | "item":"minecraft:stick" 12 | }, 13 | "$": { 14 | "item":"minecraft:bread" 15 | } 16 | }, 17 | "result": { 18 | "item": "mafishmod:bread_sword" 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/bread_sword_hot.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:campfire_cooking", 3 | "category": "food", 4 | "cookingtime": 100, 5 | "experience": 0.35, 6 | "ingredient": { 7 | "item": "mafishmod:bread_sword" 8 | }, 9 | "result": "mafishmod:bread_sword_hot" 10 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/bread_sword_very_hot.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:campfire_cooking", 3 | "category": "food", 4 | "cookingtime": 100, 5 | "experience": 0.35, 6 | "ingredient": { 7 | "item": "mafishmod:bread_sword_hot" 8 | }, 9 | "result": "mafishmod:bread_sword_very_hot" 10 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/cheese_berger.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "key": { 5 | "#": { 6 | "item": "minecraft:bread" 7 | }, 8 | "X": { 9 | "item": "minecraft:rotten_flesh" 10 | } 11 | }, 12 | "pattern": [ 13 | "#", 14 | "X", 15 | "#" 16 | ], 17 | "result": { 18 | "item": "mafishmod:cheese_berger" 19 | }, 20 | "show_notification": true 21 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/fire_fish_and_chips.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "category": "misc", 4 | "ingredients": [ 5 | { 6 | "item": "mafishmod:raw_ruby" 7 | }, 8 | { 9 | "item": "minecraft:baked_potato" 10 | } 11 | ], 12 | "result": { 13 | "item": "minecraft:suspicious_stew" 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/firework_arrow.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "category": "misc", 4 | "ingredients": [ 5 | { 6 | "item": "minecraft:arrow" 7 | }, 8 | { 9 | "item": "minecraft:firework_rocket" 10 | } 11 | ], 12 | "result": { 13 | "item": "mafishmod:firework_arrow" 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/fu.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "key": { 5 | "#": { 6 | "item": "minecraft:stick" 7 | }, 8 | "X": { 9 | "item": "mafishmod:iron_fake" 10 | } 11 | }, 12 | "pattern": [ 13 | "XX", 14 | "X#", 15 | " #" 16 | ], 17 | "result": { 18 | "item": "mafishmod:fu" 19 | }, 20 | "show_notification": true 21 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/lightning_ball.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "category": "misc", 4 | "ingredients": [ 5 | { 6 | "item": "minecraft:snowball" 7 | }, 8 | { 9 | "item": "minecraft:lightning_rod" 10 | } 11 | ], 12 | "result": { 13 | "item": "mafishmod:lightning_ball" 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/milk_flesh.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "category": "misc", 4 | "ingredients": [ 5 | { 6 | "item": "minecraft:rotten_flesh" 7 | }, 8 | { 9 | "item": "minecraft:milk_bucket" 10 | } 11 | ], 12 | "result": { 13 | "item": "mafishmod:milk_flesh" 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/poison_sword.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "category": "misc", 4 | "ingredients": [ 5 | { 6 | "item": "minecraft:pufferfish" 7 | }, 8 | { 9 | "item": "minecraft:diamond_sword" 10 | } 11 | ], 12 | "result": { 13 | "item": "mafishmod:poison_sword" 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/potato_tnt.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "category": "misc", 4 | "ingredients": [ 5 | { 6 | "item": "minecraft:potato" 7 | }, 8 | { 9 | "item": "minecraft:tnt" 10 | } 11 | ], 12 | "result": { 13 | "item": "mafishmod:potato_tnt_prepare" 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/ruby_block_from_ruby.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "pattern": [ 5 | "###", 6 | "#$#", 7 | "###" 8 | ], 9 | "key": { 10 | "#": { 11 | "item":"mafishmod:ruby" 12 | }, 13 | "$": { 14 | "item":"mafishmod:white_cat_block" 15 | } 16 | }, 17 | "result": { 18 | "item": "mafishmod:ruby_block" 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/ruby_pickaxe_from_ruby.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "pattern": [ 5 | "###", 6 | " $ ", 7 | " $ " 8 | ], 9 | "key": { 10 | "#": { 11 | "item":"mafishmod:ruby" 12 | }, 13 | "$": { 14 | "item":"minecraft:stick" 15 | } 16 | }, 17 | "result": { 18 | "item": "mafishmod:ruby_pickaxe" 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/ruby_ruby_from_block.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "category": "building", 4 | "ingredients": [ 5 | { 6 | "item": "mafishmod:ruby_block" 7 | } 8 | ], 9 | "result": { 10 | "item": "mafishmod:ruby", 11 | "count": 9 12 | } 13 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/ruby_stuff.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "equipment", 4 | "key": { 5 | "#": { 6 | "item": "minecraft:stick" 7 | }, 8 | "X": { 9 | "item": "minecraft:redstone_block" 10 | } 11 | }, 12 | "pattern": [ 13 | "X", 14 | "#", 15 | "#" 16 | ], 17 | "result": { 18 | "item": "mafishmod:ruby_staff" 19 | }, 20 | "show_notification": true 21 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/stargazy_pie.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "category": "misc", 4 | "key": { 5 | "#": { 6 | "item": "minecraft:pumpkin_pie" 7 | }, 8 | "X": { 9 | "item": "minecraft:pufferfish" 10 | } 11 | }, 12 | "pattern": [ 13 | "XXX", 14 | "X#X", 15 | "XXX" 16 | ], 17 | "result": { 18 | "item": "mafishmod:stargazy_pie" 19 | }, 20 | "show_notification": true 21 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/stone_ball.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "category": "misc", 4 | "ingredients": [ 5 | { 6 | "item": "minecraft:snowball" 7 | }, 8 | { 9 | "item": "minecraft:cobblestone" 10 | } 11 | ], 12 | "result": { 13 | "item": "mafishmod:stone_ball" 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/recipes/tnt_ball.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shapeless", 3 | "category": "misc", 4 | "ingredients": [ 5 | { 6 | "item": "minecraft:snowball" 7 | }, 8 | { 9 | "item": "minecraft:tnt" 10 | } 11 | ], 12 | "result": { 13 | "item": "mafishmod:tnt_ball" 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/tags/blocks/metal_detector_detectable_blocks.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "mafishmod:raw_ruby_block", 5 | "#minecraft:gold_ores", 6 | "#minecraft:emerald_ores", 7 | "#minecraft:redstone_ores", 8 | "#minecraft:lapis_ores", 9 | "#minecraft:diamond_ores", 10 | "#minecraft:iron_ores", 11 | "#minecraft:copper_ores", 12 | "#minecraft:coal_ores" 13 | ] 14 | } -------------------------------------------------------------------------------- /src/main/resources/data/tutorialmod/tags/items/mod_arrow_items.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "mafishmod:firework_arrow" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "mafishmod", 4 | "version": "${version}", 5 | "name": "mafishmod", 6 | "description": "These are some strange things that Mafuyu33 built while learning Minecraft mod development.", 7 | "authors": [ 8 | "Mafuyu33" 9 | ], 10 | "contact": { 11 | "homepage": "https://space.bilibili.com/5616993", 12 | "issues": "https://github.com/Mafuyu33/mafishmod/issues", 13 | "sources": "https://github.com/Mafuyu33/mafishmod" 14 | }, 15 | "license": "CC BY-NC 4.0", 16 | "icon": "assets/mafishmod/icon.png", 17 | "environment": "*", 18 | "entrypoints": { 19 | "main": [ 20 | "net.mafuyu33.mafishmod.TutorialMod" 21 | ], 22 | "client": [ 23 | "net.mafuyu33.mafishmod.TutorialModClient" 24 | ], 25 | "fabric-datagen": [ 26 | "net.mafuyu33.mafishmod.TutorialModDataGenerator" 27 | ], 28 | "modmenu": [ 29 | "net.mafuyu33.mafishmod.config.ModMenuIntegration" 30 | ] 31 | }, 32 | "mixins": [ 33 | "mafishmod.mixins.json" 34 | ], 35 | "depends": { 36 | "fabricloader": ">=0.15.1", 37 | "minecraft": "~1.20.4", 38 | "java": ">=17", 39 | "fabric-api": "*" 40 | }, 41 | "accessWidener": "mafishmod.accesswidener", 42 | "suggests": { 43 | "another-mod": "*" 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/resources/mafishmod.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v1 named 2 | accessible class net/minecraft/entity/projectile/FishingBobberEntity$State 3 | accessible field net/minecraft/entity/LivingEntity dead Z 4 | accessible method net/minecraft/block/entity/HopperBlockEntity setTransferCooldown (I)V 5 | accessible method net/minecraft/client/gui/screen/ingame/HandledScreen getSlotAt (DD)Lnet/minecraft/screen/slot/Slot; 6 | accessible class net/minecraft/entity/passive/CatEntity$TemptGoal 7 | accessible class net/minecraft/block/entity/BellBlockEntity$Effect 8 | accessible class net/minecraft/entity/passive/LlamaEntity$SpitRevengeGoal 9 | accessible field net/minecraft/entity/mob/MobEntity goalSelector Lnet/minecraft/entity/ai/goal/GoalSelector; 10 | accessible field net/minecraft/entity/FallingBlockEntity block Lnet/minecraft/block/BlockState; 11 | accessible method net/minecraft/block/entity/BlockEntity writeNbt (Lnet/minecraft/nbt/NbtCompound;)V 12 | accessible field net/minecraft/entity/FallingBlockEntity fallHurtAmount F --------------------------------------------------------------------------------