Advancements added. Zombie Ruby Worker Villager added. Ruby Ore and Deepslate Ruby Ore added to the worldgen. New Trades added also exist trades updated. Creative mod tabs updated. The version and mapping of mod changed.
Updated to 1.21.7 and official mapping.
This commit is contained in:
@@ -1,55 +0,0 @@
|
||||
/*package com.ismailkaygisiz.gamblingplus.block;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import java.util.Random;
|
||||
|
||||
public class GamblingTableBlock extends Block {
|
||||
public GamblingTableBlock(Properties properties) { super(properties); }
|
||||
|
||||
|
||||
@Override
|
||||
protected InteractionResult useItemOn(ItemStack pStack, BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand, BlockHitResult pHitResult) {
|
||||
if (!pLevel.isClientSide && pHand == InteractionHand.MAIN_HAND) {
|
||||
ItemStack held = pPlayer.getItemInHand(pHand);
|
||||
int bet = 0;
|
||||
if (held.getItem() == Items.EMERALD && held.getCount() >= 10) bet = 10;
|
||||
else if (held.getItem() == Items.EMERALD && held.getCount() >= 5) bet = 5;
|
||||
else if (held.getItem() == Items.EMERALD && held.getCount() >= 1) bet = 1;
|
||||
if (bet > 0) {
|
||||
held.shrink(bet);
|
||||
int roll = new Random().nextInt(100);
|
||||
if (roll < 40) {
|
||||
pPlayer.displayClientMessage(net.minecraft.network.chat.Component.literal("Kaybettin!"),true);
|
||||
} else if (roll < 70) {
|
||||
pPlayer.giveExperiencePoints(bet * 5);
|
||||
pPlayer.displayClientMessage(net.minecraft.network.chat.Component.literal("Kazandın! " + (bet * 5) + " XP kazandın."),true);
|
||||
} else if (roll < 85) {
|
||||
pPlayer.getInventory().add(new ItemStack(Items.GOLD_INGOT, bet));
|
||||
pPlayer.displayClientMessage(Component.literal("Kazandın! " + bet + " altın kazandın."),true);
|
||||
} else if (roll < 95) {
|
||||
pPlayer.getInventory().add(new ItemStack(Items.DIAMOND, 1));
|
||||
pPlayer.displayClientMessage(net.minecraft.network.chat.Component.literal("Büyük ödül! 1 elmas kazandın."),true);
|
||||
} else {
|
||||
pPlayer.getInventory().add(new ItemStack(Items.EMERALD, bet * 2));
|
||||
pPlayer.displayClientMessage(net.minecraft.network.chat.Component.literal("Bahsin iki katı kadar zümrüt kazandın!"),true);
|
||||
}
|
||||
return InteractionResult.SUCCESS;
|
||||
} else {
|
||||
pPlayer.displayClientMessage(net.minecraft.network.chat.Component.literal("Bahis için en az 1 zümrüt olmalı!"),true);
|
||||
return InteractionResult.FAIL;
|
||||
}
|
||||
}
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
} */
|
||||
@@ -44,7 +44,7 @@ public class ModBlocks {
|
||||
.strength(.4f)
|
||||
.requiresCorrectToolForDrops()));
|
||||
|
||||
public static final RegistryObject<Block> RAW_DEEPSLATE_ORE = registerBlock("ruby_deepslate_ore",
|
||||
public static final RegistryObject<Block> RUBY_DEEPSLATE_ORE = registerBlock("ruby_deepslate_ore",
|
||||
()-> new DropExperienceBlock(UniformInt.of(3,6),BlockBehaviour.Properties.of()
|
||||
.setId((ResourceKey.create(Registries.BLOCK, ResourceLocation.parse(String.format("%s:%s", GamblingPlusMod.MOD_ID, "ruby_deepslate_ore")))))
|
||||
.strength(.4f)
|
||||
|
||||
Reference in New Issue
Block a user