16 Commits
1.21.3 ... main

Author SHA1 Message Date
39694d4660 added turquoise 2025-07-03 23:26:11 +02:00
063dbdf0e4 added quickiepowder ore 2025-07-02 00:16:10 +02:00
12660b2525 first 1.21.7 2025-07-01 17:56:09 +02:00
c9794ad681 added copperstick 2025-06-29 21:14:39 +02:00
a68fd77238 added copper stub 2025-06-29 00:12:55 +02:00
7a9021790f added quickiepowder shears 2025-06-20 23:17:35 +02:00
b9ae4bcd52 switched to 1.21.6 2025-06-18 22:58:37 +02:00
c06c231dce added item stub slash action 2025-05-03 15:49:53 +02:00
2fedfdc700 first 1.21.5 version 2025-03-29 22:12:42 +01:00
17a11ce56a fixed exception on too many items in a slot 2025-02-08 17:27:49 +01:00
81e45c56ce fixes drill harvesting bug - drills can be mined again 2024-12-15 15:01:18 +01:00
c2558a5324 added recipe for quickiepowder generation out of mossy blocks 2024-12-14 19:11:06 +01:00
46a21b03c0 fixed block breaking bug 2024-12-12 23:18:34 +01:00
4ae1e998b0 fixes bug with recreation of block 2024-12-11 22:37:52 +01:00
06db4df2cb version 1.21.4 2024-12-04 00:55:58 +01:00
0c744ef52b fixed bug on using rangeable tools 2024-12-01 00:05:36 +01:00
161 changed files with 1309 additions and 101 deletions

View File

@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.8-SNAPSHOT'
id 'fabric-loom' version '1.10-SNAPSHOT'
id 'maven-publish'
}

View File

@ -4,14 +4,14 @@ org.gradle.parallel=true
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
loader_version=0.16.9
minecraft_version=1.21.7
yarn_mappings=1.21.7+build.2
loader_version=0.16.14
# Mod Properties
mod_version=1.21.3.1
mod_version=1.21.7.2
maven_group=de.jottyfan.quickiemod
archives_base_name=quickiemod
# Dependencies
fabric_version=0.108.0+1.21.3
fabric_version=0.128.1+1.21.7

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

View File

@ -65,9 +65,13 @@ public class Quickiemod implements ModInitializer {
registerComposterItems();
registerLootTableChanges();
ModItemGroup.registerItemGroup(items, blocks);
PlayerBlockBreakEvents.AFTER.register((world, player, pos, state, blockEntity) -> {
PlayerBlockBreakEvents.BEFORE.register((world, player, pos, state, blockEntity) -> {
Block oldBlock = state.getBlock();
new EventBlockBreak().doBreakBlock(world, pos, state, player, oldBlock);
if (new EventBlockBreak().doBreakBlock(world, pos, state, player, oldBlock)) {
return false;
} else {
return true;
}
});
}
}

View File

@ -2,8 +2,8 @@ package de.jottyfan.quickiemod;
import de.jottyfan.quickiemod.block.ModBlocks;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.minecraft.client.render.RenderLayer;
import net.fabricmc.fabric.api.client.rendering.v1.BlockRenderLayerMap;
import net.minecraft.client.render.BlockRenderLayer;
/**
*
@ -14,7 +14,7 @@ public class QuickiemodClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.BLOCK_COTTONPLANT, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.BLOCK_CANOLAPLANT, RenderLayer.getCutout());
BlockRenderLayerMap.putBlock(ModBlocks.BLOCK_COTTONPLANT, BlockRenderLayer.CUTOUT);
BlockRenderLayerMap.putBlock(ModBlocks.BLOCK_CANOLAPLANT, BlockRenderLayer.CUTOUT);
}
}

View File

@ -17,6 +17,8 @@ import net.minecraft.loot.context.LootWorldContext.Builder;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
/**
*
@ -45,4 +47,9 @@ public class BlockDirtSalpeter extends FallingBlock {
protected MapCodec<? extends FallingBlock> getCodec() {
return null;
}
@Override
public int getColor(BlockState state, BlockView world, BlockPos pos) {
return 0;
}
}

View File

@ -31,6 +31,7 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
/**
@ -41,10 +42,11 @@ import net.minecraft.world.World;
public class BlockDrill extends FallingBlock implements BlockEntityProvider {
private static final Integer MAX_FUEL = 255;
public static final IntProperty FUEL = IntProperty.of("fuel", 0, MAX_FUEL);
public static final EnumProperty<Direction> DIRECTION = EnumProperty.of("direction", Direction.class, Direction.values());
public static final EnumProperty<Direction> DIRECTION = EnumProperty.of("direction", Direction.class,
Direction.values());
public BlockDrill(Identifier identifier, Direction direction) {
super(AbstractBlock.Settings.create().hardness(2.5f).registryKey(RegistryKey.of(RegistryKeys.BLOCK, identifier)));
super(AbstractBlock.Settings.create().hardness(0.5f).registryKey(RegistryKey.of(RegistryKeys.BLOCK, identifier)));
setDefaultState(getDefaultState().with(FUEL, 0).with(DIRECTION, direction));
}
@ -68,8 +70,20 @@ public class BlockDrill extends FallingBlock implements BlockEntityProvider {
@Override
public BlockState onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
Integer fuelLeft = state.get(FUEL);
Direction dir = state.get(DIRECTION);
world.spawnEntity(
new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(ModItems.ITEM_CANOLABOTTLE, fuelLeft)));
Block thisBlock = ModBlocks.BLOCK_DRILL_DOWN;
if (Direction.EAST.equals(dir)) {
thisBlock = ModBlocks.BLOCK_DRILL_EAST;
} else if (Direction.SOUTH.equals(dir)) {
thisBlock = ModBlocks.BLOCK_DRILL_SOUTH;
} else if (Direction.WEST.equals(dir)) {
thisBlock = ModBlocks.BLOCK_DRILL_WEST;
} else if (Direction.NORTH.equals(dir)) {
thisBlock = ModBlocks.BLOCK_DRILL_NORTH;
}
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(thisBlock)));
return super.onBreak(world, pos, state, player);
}
@ -109,4 +123,9 @@ public class BlockDrill extends FallingBlock implements BlockEntityProvider {
}
return ActionResult.PASS;
}
@Override
public int getColor(BlockState state, BlockView world, BlockPos pos) {
return 0;
}
}

View File

@ -34,7 +34,7 @@ import net.minecraft.world.tick.OrderedTick;
*/
public class BlockMonsterhoarder extends Block {
private static final IntProperty SUCKRADIUS = IntProperty.of("suckradius", 1, 15);
private static final IntProperty SUCKRADIUS = IntProperty.of("suckradius", 2, 20);
public BlockMonsterhoarder(Identifier identifier) {
super(AbstractBlock.Settings.create().hardness(2.5f).luminance(state -> state.get(BlockMonsterhoarder.SUCKRADIUS))

View File

@ -0,0 +1,31 @@
package de.jottyfan.quickiemod.block;
import java.util.Arrays;
import java.util.List;
import de.jottyfan.quickiemod.block.help.IntProviderHelper;
import de.jottyfan.quickiemod.item.ModItems;
import net.minecraft.block.BlockState;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootWorldContext.Builder;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
/**
*
* @author jotty
*
*/
public class BlockOreDeepslateSpeedpowder extends ExperienceDroppingBlock {
public BlockOreDeepslateSpeedpowder(Identifier identifier) {
super(IntProviderHelper.of(0, 2), Settings.create().strength(2.5f).hardness(1.9f).requiresTool().registryKey(RegistryKey.of(RegistryKeys.BLOCK, identifier)));
}
@Override
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
return Arrays.asList(new ItemStack[] { new ItemStack(ModItems.ITEM_SPEEDPOWDER, 2) });
}
}

View File

@ -0,0 +1,33 @@
package de.jottyfan.quickiemod.block;
import java.util.Arrays;
import java.util.List;
import de.jottyfan.quickiemod.block.help.IntProviderHelper;
import de.jottyfan.quickiemod.item.ModItems;
import net.minecraft.block.BlockState;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootWorldContext.Builder;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;
/**
*
* @author jotty
*
*/
public class BlockOreDeepslateTurquoise extends ExperienceDroppingBlock {
public BlockOreDeepslateTurquoise(Identifier identifier) {
super(IntProviderHelper.of(0, 2), Settings.create().strength(3.0f).hardness(3.5f).sounds(BlockSoundGroup.AMETHYST_BLOCK)
.requiresTool().registryKey(RegistryKey.of(RegistryKeys.BLOCK, identifier)));
}
@Override
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
return Arrays.asList(new ItemStack[] { new ItemStack(ModItems.ITEM_RAWTURQUOISE, 2) });
}
}

View File

@ -0,0 +1,31 @@
package de.jottyfan.quickiemod.block;
import java.util.Arrays;
import java.util.List;
import de.jottyfan.quickiemod.block.help.IntProviderHelper;
import de.jottyfan.quickiemod.item.ModItems;
import net.minecraft.block.BlockState;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootWorldContext.Builder;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
/**
*
* @author jotty
*
*/
public class BlockOreSpeedpowder extends ExperienceDroppingBlock {
public BlockOreSpeedpowder(Identifier identifier) {
super(IntProviderHelper.of(0, 2), Settings.create().strength(2.5f).hardness(1.9f).requiresTool().registryKey(RegistryKey.of(RegistryKeys.BLOCK, identifier)));
}
@Override
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
return Arrays.asList(new ItemStack[] { new ItemStack(ModItems.ITEM_SPEEDPOWDER) });
}
}

View File

@ -0,0 +1,33 @@
package de.jottyfan.quickiemod.block;
import java.util.Arrays;
import java.util.List;
import de.jottyfan.quickiemod.block.help.IntProviderHelper;
import de.jottyfan.quickiemod.item.ModItems;
import net.minecraft.block.BlockState;
import net.minecraft.block.ExperienceDroppingBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootWorldContext.Builder;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;
/**
*
* @author jotty
*
*/
public class BlockOreTurquoise extends ExperienceDroppingBlock {
public BlockOreTurquoise(Identifier identifier) {
super(IntProviderHelper.of(0, 2), Settings.create().strength(3.0f).hardness(3.5f).sounds(BlockSoundGroup.AMETHYST_BLOCK)
.requiresTool().registryKey(RegistryKey.of(RegistryKeys.BLOCK, identifier)));
}
@Override
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
return Arrays.asList(new ItemStack[] { new ItemStack(ModItems.ITEM_RAWTURQUOISE) });
}
}

View File

@ -13,6 +13,8 @@ import net.minecraft.loot.context.LootWorldContext.Builder;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
import net.minecraft.world.explosion.Explosion;
/**
@ -44,4 +46,10 @@ public class BlockPowder extends FallingBlock {
// TODO Auto-generated method stub
return null;
}
@Override
public int getColor(BlockState state, BlockView world, BlockPos pos) {
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -15,7 +15,9 @@ import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockView;
/**
*
@ -40,4 +42,10 @@ public class BlockSandSalpeter extends FallingBlock {
// TODO Auto-generated method stub
return null;
}
@Override
public int getColor(BlockState state, BlockView world, BlockPos pos) {
// TODO Auto-generated method stub
return 0;
}
}

View File

@ -16,6 +16,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Identifier;
import net.minecraft.util.ItemScatterer;
@ -93,15 +94,15 @@ public class BlockStacker extends BlockWithEntity implements BlockEntityProvider
}
@Override
public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) {
if (state.getBlock() != newState.getBlock()) {
protected void onStateReplaced(BlockState state, ServerWorld world, BlockPos pos, boolean moved) {
if (state.getBlock() != world.getBlockState(pos).getBlock()) {
BlockEntity blockEntity = world.getBlockEntity(pos);
if (blockEntity instanceof BlockStackerEntity) {
ItemScatterer.spawn(world, pos, (BlockStackerEntity) blockEntity);
// update comparators
world.updateComparators(pos, this);
}
super.onStateReplaced(state, world, pos, newState, moved);
super.onStateReplaced(state, world, pos, moved);
}
}

View File

@ -53,8 +53,16 @@ public class ModBlocks {
new BlockOreSandSalpeter(ModIdentifiers.BLOCK_ORESANDSALPETER));
public static final Block BLOCK_ORESULFOR = registerBlock(ModIdentifiers.BLOCK_ORESULFOR,
new BlockOreSulphor(ModIdentifiers.BLOCK_ORESULFOR));
public static final Block BLOCK_ORESPEEDPOWDER = registerBlock(ModIdentifiers.BLOCK_ORESPEEDPOWDER,
new BlockOreSpeedpowder(ModIdentifiers.BLOCK_ORESPEEDPOWDER));
public static final Block BLOCK_OREDEEPSLATESPEEDPOWDER = registerBlock(ModIdentifiers.BLOCK_OREDEEPSLATESPEEDPOWDER,
new BlockOreDeepslateSpeedpowder(ModIdentifiers.BLOCK_OREDEEPSLATESPEEDPOWDER));
public static final Block BLOCK_SANDSALPETER = registerBlock(ModIdentifiers.BLOCK_SANDSALPETER,
new BlockSandSalpeter(ModIdentifiers.BLOCK_SANDSALPETER));
public static final Block BLOCK_ORETURQUOISE = registerBlock(ModIdentifiers.BLOCK_ORETURQUOISE,
new BlockOreTurquoise(ModIdentifiers.BLOCK_ORETURQUOISE));
public static final Block BLOCK_OREDEEPSLATETURQUOISE = registerBlock(ModIdentifiers.BLOCK_OREDEEPSLATETURQUOISE,
new BlockOreDeepslateTurquoise(ModIdentifiers.BLOCK_OREDEEPSLATETURQUOISE));
public static final Block BLOCK_KELPSTACK = registerBlock(ModIdentifiers.BLOCK_KELPSTACK,
new BlockSlippery(ModIdentifiers.BLOCK_KELPSTACK, 0.1f, 1.0f, BlockSoundGroup.WET_GRASS));
public static final Block BLOCK_COTTONPLANT = registerBlock(ModIdentifiers.BLOCK_COTTONPLANT,
@ -114,7 +122,11 @@ public class ModBlocks {
blocks.add(BLOCK_ORESALPETER);
blocks.add(BLOCK_ORESANDSALPETER);
blocks.add(BLOCK_ORESULFOR);
blocks.add(BLOCK_ORESPEEDPOWDER);
blocks.add(BLOCK_OREDEEPSLATESPEEDPOWDER);
blocks.add(BLOCK_SANDSALPETER);
blocks.add(BLOCK_ORETURQUOISE);
blocks.add(BLOCK_OREDEEPSLATETURQUOISE);
blocks.add(BLOCK_KELPSTACK);
blocks.add(BLOCK_DRILL_DOWN);
blocks.add(BLOCK_DRILL_EAST);

View File

@ -16,10 +16,10 @@ import net.minecraft.inventory.Inventories;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.registry.RegistryWrapper.WrapperLookup;
import net.minecraft.screen.NamedScreenHandlerFactory;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.storage.ReadView;
import net.minecraft.storage.WriteView;
import net.minecraft.text.Text;
import net.minecraft.util.collection.DefaultedList;
import net.minecraft.util.math.BlockPos;
@ -78,15 +78,15 @@ public class BlockStackerEntity extends BlockEntity implements NamedScreenHandle
}
@Override
protected void readNbt(NbtCompound nbt, WrapperLookup registryLookup) {
super.readNbt(nbt, registryLookup);
Inventories.readNbt(nbt, inventory, registryLookup);
protected void readData(ReadView view) {
super.readData(view);
Inventories.readData(view, inventory);
}
@Override
protected void writeNbt(NbtCompound nbt, WrapperLookup registryLookup) {
Inventories.writeNbt(nbt, inventory, registryLookup);
super.writeNbt(nbt, registryLookup);
protected void writeData(WriteView view) {
Inventories.writeData(view, inventory);
super.writeData(view);
}
/**

View File

@ -14,9 +14,9 @@ import net.minecraft.inventory.Inventories;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.registry.RegistryWrapper.WrapperLookup;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.storage.ReadView;
import net.minecraft.storage.WriteView;
import net.minecraft.text.Text;
import net.minecraft.util.collection.DefaultedList;
import net.minecraft.util.math.BlockPos;
@ -30,7 +30,6 @@ import net.minecraft.world.World;
*/
public class ItemHoarderBlockEntity extends LootableContainerBlockEntity {
private DefaultedList<ItemStack> stacks;
private float suckradius;
@ -44,9 +43,17 @@ public class ItemHoarderBlockEntity extends LootableContainerBlockEntity {
public final static boolean setStackToSlots(ItemStack stack, List<ItemStack> stacks) {
for (ItemStack slot : stacks) {
Integer sum = stack.getCount() + slot.getCount();
if (slot.getItem().equals(stack.getItem())) {
if (slot.getItem().getMaxCount() >= sum) {
slot.increment(stack.getCount());
return true;
} else {
Integer transferSize = 64 - stack.getCount();
stack.setCount(stack.getCount() - transferSize);
slot.setCount(64);
// to not return sth. here so that the next loop will sum up the result
}
}
} // if not found, seek for an empty stack instead
for (ItemStack slot : stacks) {
@ -81,19 +88,19 @@ public class ItemHoarderBlockEntity extends LootableContainerBlockEntity {
}
@Override
protected void writeNbt(NbtCompound nbt, WrapperLookup registryLookup) {
super.writeNbt(nbt, registryLookup);
if (!this.writeLootTable(nbt)) {
Inventories.writeNbt(nbt, this.stacks, registryLookup);
protected void writeData(WriteView view) {
super.writeData(view);
if (!this.writeLootTable(view)) {
Inventories.writeData(view, this.stacks);
}
}
@Override
protected void readNbt(NbtCompound nbt, WrapperLookup registryLookup) {
super.readNbt(nbt, registryLookup);
protected void readData(ReadView view) {
super.readData(view);
this.stacks = DefaultedList.ofSize(this.size(), ItemStack.EMPTY);
if (!this.readLootTable(nbt)) {
Inventories.readNbt(nbt, this.stacks, registryLookup);
if (!this.readLootTable(view)){
Inventories.readData(view, this.stacks);
}
}

View File

@ -3,10 +3,10 @@ package de.jottyfan.quickiemod.event;
import java.util.ArrayList;
import java.util.List;
import de.jottyfan.quickiemod.Quickiemod;
import de.jottyfan.quickiemod.item.HarvestRange;
import de.jottyfan.quickiemod.item.ModItems;
import de.jottyfan.quickiemod.item.ToolRangeable;
import de.jottyfan.quickiemod.item.ToolSpeedpowderAxe;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
@ -28,23 +28,40 @@ public class EventBlockBreak {
UPWARDS, ALL;
}
public void doBreakBlock(World world, BlockPos blockPos, BlockState blockState, PlayerEntity playerEntity, Block oldBlock) {
/**
* break surrounding block if item is of ToolRangeable
*
* @param world
* @param blockPos
* @param blockState
* @param playerEntity
* @param oldBlock
* @return true if this range breaking routine has been used, false otherwise
*/
public boolean doBreakBlock(World world, BlockPos blockPos, BlockState blockState, PlayerEntity playerEntity, Block oldBlock) {
ItemStack mainHandItemStack = playerEntity.getEquippedStack(EquipmentSlot.MAINHAND);
if (mainHandItemStack != null) {
Item item = mainHandItemStack.getItem();
if (item instanceof ToolRangeable) {
ToolRangeable tool = (ToolRangeable) item;
if (!world.getBlockState(blockPos).getBlock().equals(oldBlock)) {
// recreate old block to make it breakable; otherwise, the recursive algorithm stops directly
world.setBlockState(blockPos, oldBlock.getDefaultState());
}
// not needed when added to before block break
// if (!world.getBlockState(blockPos).getBlock().equals(oldBlock)) {
// // recreate old block to make it breakable; otherwise, the recursive algorithm stops directly
// // this leads to the BUG that blocks with no neighbour will respawn and drop -> unlimited items.
// world.setBlockState(blockPos, oldBlock.getDefaultState());
// }
int handled = handleRangeableTools(tool, mainHandItemStack, world, oldBlock, blockPos, playerEntity);
if (handled >= 255) {
// reward for using rangeable tool very successful
world.spawnEntity(
new ExperienceOrbEntity(world, blockPos.getX(), blockPos.getY(), blockPos.getZ(), handled / 255));
}
return handled > 0; // this way, a rangeable pickaxe can break a dirt block
} else {
return false;
}
} else {
return false;
}
}
@ -63,34 +80,40 @@ public class EventBlockBreak {
BlockPos pos, PlayerEntity player) {
List<Block> validBlocks = tool.getBlockList(currentBlock);
HarvestRange range = tool.getRange(itemStack);
if (tool instanceof Item) {
Item toolItem = (Item) tool; // a rangeable tool should always be an item
List<String> visitedBlocks = new ArrayList<>();
if (tool instanceof ToolSpeedpowderAxe) {
if (ModItems.TOOL_SPEEDPOWDERAXE.getName().equals(toolItem.getName())) {
return breakBlockRecursive(visitedBlocks, world, validBlocks, pos, tool, range, BlockBreakDirection.UPWARDS,
player, true);
} else if (ModItems.TOOL_SPEEDPOWDERPICKAXE.getName().equals(tool.getName())) {
} else if (ModItems.TOOL_SPEEDPOWDERPICKAXE.getName().equals(toolItem.getName())) {
return breakBlockRecursive(visitedBlocks, world, validBlocks, pos, tool, range, BlockBreakDirection.ALL,
player, false);
} else if (ModItems.TOOL_SPEEDPOWDERSHOVEL.getName().equals(tool.getName())) {
} else if (ModItems.TOOL_SPEEDPOWDERSHOVEL.getName().equals(toolItem.getName())) {
return breakBlockRecursive(visitedBlocks, world, validBlocks, pos, tool, range, BlockBreakDirection.ALL,
player, false);
} else if (ModItems.TOOL_SPEEDPOWDERHOE.getName().equals(tool.getName())) {
} else if (ModItems.TOOL_SPEEDPOWDERHOE.getName().equals(toolItem.getName())) {
return breakBlockRecursive(visitedBlocks, world, validBlocks, pos, tool, range, BlockBreakDirection.ALL,
player, false);
} else if (ModItems.TOOL_QUICKIEPOWDERAXE.getName().equals(tool.getName())) {
} else if (ModItems.TOOL_QUICKIEPOWDERAXE.getName().equals(toolItem.getName())) {
return breakBlockRecursive(visitedBlocks, world, validBlocks, pos, tool, range, BlockBreakDirection.UPWARDS,
player, true);
} else if (ModItems.TOOL_QUICKIEPOWDERPICKAXE.getName().equals(tool.getName())) {
} else if (ModItems.TOOL_QUICKIEPOWDERPICKAXE.getName().equals(toolItem.getName())) {
return breakBlockRecursive(visitedBlocks, world, validBlocks, pos, tool, range, BlockBreakDirection.ALL,
player, false);
} else if (ModItems.TOOL_QUICKIEPOWDERSHOVEL.getName().equals(tool.getName())) {
} else if (ModItems.TOOL_QUICKIEPOWDERSHOVEL.getName().equals(toolItem.getName())) {
return breakBlockRecursive(visitedBlocks, world, validBlocks, pos, tool, range, BlockBreakDirection.ALL,
player, false);
} else if (ModItems.TOOL_QUICKIEPOWDERHOE.getName().equals(tool.getName())) {
} else if (ModItems.TOOL_QUICKIEPOWDERHOE.getName().equals(toolItem.getName())) {
return breakBlockRecursive(visitedBlocks, world, validBlocks, pos, tool, range, BlockBreakDirection.ALL,
player, false);
} else {
return 0;
}
} else {
Quickiemod.LOGGER.warn("using a tool that is not an item - no rangeable operations are possible.");
return 0;
}
}
/**
@ -109,7 +132,7 @@ public class EventBlockBreak {
private int breakBlockRecursive(List<String> visitedBlocks, World world, List<Block> validBlocks, BlockPos pos,
ToolRangeable tool, HarvestRange range, BlockBreakDirection blockBreakDirection, PlayerEntity player,
boolean breakLeaves) {
boolean ignoreSpawn = visitedBlocks.size() < 1; // with this, the already broken block can be omitted to spawn
// boolean ignoreSpawn = visitedBlocks.size() < 1; // with this, the already broken block can be omitted to spawn
if (visitedBlocks.contains(pos.toString())) {
return 0;
} else if (validBlocks == null) {
@ -122,9 +145,9 @@ public class EventBlockBreak {
if (tool.canBreakNeighbors(blockState)) {
Block currentBlock = blockState.getBlock();
if (validBlocks.contains(currentBlock)) {
if (!ignoreSpawn) {
// if (!ignoreSpawn) {
Block.dropStacks(blockState, world, pos); // includes xorbs
}
// }
affected += 1;
world.setBlockState(pos, Blocks.AIR.getDefaultState());
if (range == null || range.getxRange() > 1 || range.getyRange() > 1 || range.getzRange() > 1) {

View File

@ -26,6 +26,8 @@ public class ModFeatures {
public static final RegistryKey<ConfiguredFeature<?, ?>> CF_DIRTSALPETER = genCf("dirtsalpeter");
public static final RegistryKey<ConfiguredFeature<?, ?>> CF_SANDSALPETER = genCf("sandsalpeter");
public static final RegistryKey<ConfiguredFeature<?, ?>> CF_ORESANDSALPETER = genCf("oresandsalpeter");
public static final RegistryKey<ConfiguredFeature<?, ?>> CF_ORESPEEDPOWDER = genCf("orespeedpowder");
public static final RegistryKey<ConfiguredFeature<?, ?>> CF_ORETURQUOISE = genCf("oreturquoise");
public static final RegistryKey<PlacedFeature> PF_ORESULPHOR = genPf("oresulphor");
public static final RegistryKey<PlacedFeature> PF_OREDEEPSLATESULPHOR = genPf("oredeepslatesulphor");
@ -35,6 +37,8 @@ public class ModFeatures {
public static final RegistryKey<PlacedFeature> PF_DIRTSALPETER = genPf("dirtsalpeter");
public static final RegistryKey<PlacedFeature> PF_SANDSALPETER = genPf("sandsalpeter");
public static final RegistryKey<PlacedFeature> PF_ORESANDSALPETER = genPf("oresandsalpeter");
public static final RegistryKey<PlacedFeature> PF_ORESPEEDPOWDER = genPf("orespeedpowder");
public static final RegistryKey<PlacedFeature> PF_ORETURQUOISE = genPf("oreturquoise");
private static final RegistryKey<ConfiguredFeature<?, ?>> genCf(String name) {
return RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Identifier.of(Quickiemod.MOD_ID, name));
@ -54,6 +58,8 @@ public class ModFeatures {
bmc.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_ORES, PF_SANDSALPETER);
bmc.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_ORES, PF_ORESANDSALPETER);
bmc.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_ORES, PF_OREDEEPSLATESULPHOR);
bmc.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_ORES, PF_ORESPEEDPOWDER);
bmc.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_ORES, PF_ORETURQUOISE);
});
// Nether features

View File

@ -27,6 +27,12 @@ public class ModIdentifiers {
public static final Identifier ITEM_CANOLASEED = Identifier.of(Quickiemod.MOD_ID, "canolaseed");
public static final Identifier ITEM_CANOLABOTTLE = Identifier.of(Quickiemod.MOD_ID, "canolabottle");
public static final Identifier ITEM_CANOLABOTTLESTACK = Identifier.of(Quickiemod.MOD_ID, "canolabottlestack");
public static final Identifier ITEM_COPPERSTRING = Identifier.of(Quickiemod.MOD_ID, "copperstring");
public static final Identifier ITEM_COPPERPOWDER = Identifier.of(Quickiemod.MOD_ID, "copperpowder");
public static final Identifier ITEM_COPPERSTUB = Identifier.of(Quickiemod.MOD_ID, "copperstub");
public static final Identifier ITEM_COPPERSTICK = Identifier.of(Quickiemod.MOD_ID, "copperstick");
public static final Identifier ITEM_RAWTURQUOISE = Identifier.of(Quickiemod.MOD_ID, "rawturquoise");
public static final Identifier ITEM_TURQUOISEINGOT = Identifier.of(Quickiemod.MOD_ID, "turquoiseingot");
public static final Identifier TOOL_SPEEDPOWDERAXE = Identifier.of(Quickiemod.MOD_ID, "speedpowderaxe");
public static final Identifier TOOL_SPEEDPOWDERHOE = Identifier.of(Quickiemod.MOD_ID, "speedpowderhoe");
@ -39,6 +45,7 @@ public class ModIdentifiers {
public static final Identifier TOOL_QUICKIEPOWDERPICKAXE = Identifier.of(Quickiemod.MOD_ID, "quickiepowderpickaxe");
public static final Identifier TOOL_QUICKIEPOWDERSHOVEL = Identifier.of(Quickiemod.MOD_ID, "quickiepowdershovel");
public static final Identifier TOOL_QUICKIEPOWDERWATERHOE = Identifier.of(Quickiemod.MOD_ID, "quickiepowderwaterhoe");
public static final Identifier TOOL_QUICKIEPOWDERSHEARS = Identifier.of(Quickiemod.MOD_ID, "quickiepowdershears");
public static final Identifier BLOCK_QUICKIEPOWDER = Identifier.of(Quickiemod.MOD_ID, "blockquickiepowder");
public static final Identifier BLOCK_SPEEDPOWDER = Identifier.of(Quickiemod.MOD_ID, "blockspeedpowder");
@ -54,6 +61,10 @@ public class ModIdentifiers {
public static final Identifier BLOCK_ORESALPETER = Identifier.of(Quickiemod.MOD_ID, "oresalpeter");
public static final Identifier BLOCK_ORESANDSALPETER = Identifier.of(Quickiemod.MOD_ID, "oresandsalpeter");
public static final Identifier BLOCK_ORESULFOR = Identifier.of(Quickiemod.MOD_ID, "oresulphor");
public static final Identifier BLOCK_ORESPEEDPOWDER = Identifier.of(Quickiemod.MOD_ID, "orespeedpowder");
public static final Identifier BLOCK_OREDEEPSLATESPEEDPOWDER = Identifier.of(Quickiemod.MOD_ID, "oredeepslatespeedpowder");
public static final Identifier BLOCK_ORETURQUOISE = Identifier.of(Quickiemod.MOD_ID, "oreturquoise");
public static final Identifier BLOCK_OREDEEPSLATETURQUOISE = Identifier.of(Quickiemod.MOD_ID, "oredeepslateturquoise");
public static final Identifier BLOCK_SANDSALPETER = Identifier.of(Quickiemod.MOD_ID, "sandsalpeter");
public static final Identifier BLOCK_KELPSTACK = Identifier.of(Quickiemod.MOD_ID, "kelpstack");
public static final Identifier BLOCK_COTTONPLANT = Identifier.of(Quickiemod.MOD_ID, "blockcottonplant");

View File

@ -0,0 +1,54 @@
package de.jottyfan.quickiemod.item;
import java.util.Map;
import java.util.Random;
import de.jottyfan.quickiemod.block.ModBlocks;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.entity.ItemEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUsageContext;
import net.minecraft.item.Items;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class ItemStub extends AbstractIdentifiedItem {
public ItemStub(Identifier identifier) {
super(identifier, 64);
}
@Override
public ActionResult useOnBlock(ItemUsageContext context) {
Map<Block, Item> SLASH_MAP = Map.of(
Blocks.HAY_BLOCK, Items.WHEAT,
Blocks.DRIED_KELP_BLOCK, Items.DRIED_KELP,
ModBlocks.BLOCK_KELPSTACK, Items.KELP);
World world = context.getWorld();
BlockPos pos = context.getBlockPos();
Block clickedBlock = world.getBlockState(pos).getBlock();
if (SLASH_MAP.containsKey(clickedBlock)) {
if (!world.isClient()) {
world.setBlockState(pos, Blocks.AIR.getDefaultState());
world.playSound(null, pos, SoundEvents.ITEM_HOE_TILL,
SoundCategory.BLOCKS);
for (int i = 0; i < 9; i++) {
ItemStack stack = new ItemStack(SLASH_MAP.get(clickedBlock));
float xScatter = new Random().nextFloat();
float yScatter = new Random().nextFloat();
ItemEntity entity = new ItemEntity(world, pos.getX(), pos.getY(), pos.getZ(),
stack, xScatter, yScatter, 0.2);
world.spawnEntity(entity);
}
}
}
return ActionResult.SUCCESS;
}
}

View File

@ -17,7 +17,7 @@ import net.minecraft.util.Identifier;
*/
public class ModItems {
public static final Item ITEM_STUB = registerItem(ModIdentifiers.ITEM_STUB,
new Item64Stack(ModIdentifiers.ITEM_STUB));
new ItemStub(ModIdentifiers.ITEM_STUB));
public static final Item ITEM_SPEEDPOWDER = registerItem(ModIdentifiers.ITEM_SPEEDPOWDER,
new Item64Stack(ModIdentifiers.ITEM_SPEEDPOWDER));
public static final Item ITEM_QUICKIEPOWDER = registerItem(ModIdentifiers.ITEM_QUICKIEPOWDER,
@ -52,6 +52,18 @@ public class ModItems {
new Item64Stack(ModIdentifiers.ITEM_CANOLABOTTLE));
public static final Item ITEM_CANOLABOTTLESTACK = registerItem(ModIdentifiers.ITEM_CANOLABOTTLESTACK,
new Item64Stack(ModIdentifiers.ITEM_CANOLABOTTLESTACK));
public static final Item ITEM_COPPERSTRING = registerItem(ModIdentifiers.ITEM_COPPERSTRING,
new Item64Stack(ModIdentifiers.ITEM_COPPERSTRING));
public static final Item ITEM_COPPERPOWDER = registerItem(ModIdentifiers.ITEM_COPPERPOWDER,
new Item64Stack(ModIdentifiers.ITEM_COPPERPOWDER));
public static final Item ITEM_COPPERSTUB = registerItem(ModIdentifiers.ITEM_COPPERSTUB,
new Item64Stack(ModIdentifiers.ITEM_COPPERSTUB));
public static final Item ITEM_COPPERSTICK = registerItem(ModIdentifiers.ITEM_COPPERSTICK,
new Item64Stack(ModIdentifiers.ITEM_COPPERSTICK));
public static final Item ITEM_RAWTURQUOISE = registerItem(ModIdentifiers.ITEM_RAWTURQUOISE,
new Item64Stack(ModIdentifiers.ITEM_RAWTURQUOISE));
public static final Item ITEM_TURQUOISEINGOT = registerItem(ModIdentifiers.ITEM_TURQUOISEINGOT,
new Item64Stack(ModIdentifiers.ITEM_TURQUOISEINGOT));
public static final Item TOOL_SPEEDPOWDERAXE = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERAXE,
new ToolSpeedpowderAxe(ModIdentifiers.TOOL_SPEEDPOWDERAXE));
@ -75,6 +87,8 @@ public class ModItems {
new ToolQuickiepowderShovel(ModIdentifiers.TOOL_QUICKIEPOWDERSHOVEL));
public static final Item TOOL_QUICKIEPOWDERWATERHOE = registerItem(ModIdentifiers.TOOL_QUICKIEPOWDERWATERHOE,
new ToolQuickiepowderWaterHoe(ModIdentifiers.TOOL_QUICKIEPOWDERWATERHOE));
public static final Item TOOL_QUICKIEPOWDERSHEARS = registerItem(ModIdentifiers.TOOL_QUICKIEPOWDERSHEARS,
new ToolSpeedpowderShears(ModIdentifiers.TOOL_QUICKIEPOWDERSHEARS));
private static final Item registerItem(Identifier identifier, Item item) {
return Registry.register(Registries.ITEM, identifier, item);
@ -100,6 +114,12 @@ public class ModItems {
items.add(ITEM_CANOLASEED);
items.add(ITEM_CANOLABOTTLE);
items.add(ITEM_CANOLABOTTLESTACK);
items.add(ITEM_COPPERPOWDER);
items.add(ITEM_COPPERSTRING);
items.add(ITEM_COPPERSTICK);
items.add(ITEM_COPPERSTUB);
items.add(ITEM_RAWTURQUOISE);
items.add(ITEM_TURQUOISEINGOT);
items.add(TOOL_SPEEDPOWDERPICKAXE);
items.add(TOOL_SPEEDPOWDERAXE);
@ -112,6 +132,7 @@ public class ModItems {
items.add(TOOL_QUICKIEPOWDERSHOVEL);
items.add(TOOL_QUICKIEPOWDERHOE);
items.add(TOOL_QUICKIEPOWDERWATERHOE);
items.add(TOOL_QUICKIEPOWDERSHEARS);
return items;
}
}

View File

@ -8,7 +8,6 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.PickaxeItem;
import net.minecraft.item.ToolMaterial;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
@ -21,13 +20,13 @@ import net.minecraft.util.Identifier;
* @author jotty
*
*/
public class ToolQuickiepowderPickaxe extends PickaxeItem implements ToolRangeable {
public class ToolQuickiepowderPickaxe extends Item implements ToolRangeable {
public static final int[] DEFAULT_HARVEST_RANGE = new int[] { 6, 6, 6 };
private final static ToolMaterial MATERIAL = new ToolMaterial(BlockTags.INCORRECT_FOR_DIAMOND_TOOL, 2400, 7f, 1f, 15, ItemTags.DIAMOND_TOOL_MATERIALS);
public ToolQuickiepowderPickaxe(Identifier identifier) {
super(MATERIAL, 7F, -3.1F, new Item.Settings().useItemPrefixedTranslationKey().registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier)));
super(new Item.Settings().pickaxe(MATERIAL, 7F, -3.1F).useItemPrefixedTranslationKey().registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier)));
}
@Override

View File

@ -0,0 +1,102 @@
package de.jottyfan.quickiemod.item;
import java.util.Random;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.passive.ChickenEntity;
import net.minecraft.entity.passive.CowEntity;
import net.minecraft.entity.passive.HorseEntity;
import net.minecraft.entity.passive.SheepEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.ShearsItem;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.ActionResult;
import net.minecraft.util.DyeColor;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Vec3d;
/**
*
* @author jotty
*
*/
public class ToolQuickiepowderShears extends ShearsItem {
public ToolQuickiepowderShears(Identifier identifier) {
super(new Item.Settings().component(DataComponentTypes.TOOL, ShearsItem.createToolComponent()).useItemPrefixedTranslationKey().registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier)));
}
@Override
public ActionResult useOnEntity(ItemStack stack, PlayerEntity user, LivingEntity entity, Hand hand) {
Vec3d pos = entity.getPos();
Integer amount = 3 + new Random().nextInt(4);
if (entity instanceof SheepEntity) {
SheepEntity sheep = (SheepEntity) entity;
if (sheep.isShearable()) {
sheep.setSheared(true);
sheep.playAmbientSound();
DyeColor color = sheep.getColor();
Item item = Items.WHITE_WOOL;
if (color.equals(DyeColor.BLACK)) {
item = Items.BLACK_WOOL;
} else if (color.equals(DyeColor.GRAY)) {
item = Items.GRAY_WOOL;
} else if (color.equals(DyeColor.LIGHT_GRAY)) {
item = Items.LIGHT_GRAY_WOOL;
} else if (color.equals(DyeColor.BROWN)) {
item = Items.BROWN_WOOL;
} else if (color.equals(DyeColor.BLUE)) {
item = Items.BLUE_WOOL;
} else if (color.equals(DyeColor.LIGHT_BLUE)) {
item = Items.LIGHT_BLUE_WOOL;
} else if (color.equals(DyeColor.GREEN)) {
item = Items.GREEN_WOOL;
} else if (color.equals(DyeColor.LIME)) {
item = Items.LIME_WOOL;
} else if (color.equals(DyeColor.CYAN)) {
item = Items.CYAN_WOOL;
} else if (color.equals(DyeColor.MAGENTA)) {
item = Items.MAGENTA_WOOL;
} else if (color.equals(DyeColor.ORANGE)) {
item = Items.ORANGE_WOOL;
} else if (color.equals(DyeColor.PINK)) {
item = Items.PINK_WOOL;
} else if (color.equals(DyeColor.PURPLE)) {
item = Items.PURPLE_WOOL;
} else if (color.equals(DyeColor.RED)) {
item = Items.RED_WOOL;
} else if (color.equals(DyeColor.YELLOW)) {
item = Items.YELLOW_WOOL;
}
user.getWorld().spawnEntity(new ItemEntity(user.getWorld(), pos.getX(), pos.getY(), pos.getZ(), new ItemStack(item, amount)));
return ActionResult.SUCCESS;
}
} else if (entity instanceof HorseEntity) {
HorseEntity horse = (HorseEntity) entity;
horse.playAmbientSound();
horse.setBaby(true);
user.getWorld().spawnEntity(new ItemEntity(user.getWorld(), pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.LEATHER, amount)));
return ActionResult.SUCCESS;
} else if (entity instanceof CowEntity) {
CowEntity cow = (CowEntity) entity;
cow.playAmbientSound();
cow.setBaby(true);
user.getWorld().spawnEntity(new ItemEntity(user.getWorld(), pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.LEATHER, amount)));
return ActionResult.SUCCESS;
} else if (entity instanceof ChickenEntity) {
ChickenEntity chicken = (ChickenEntity) entity;
chicken.playAmbientSound();
chicken.setBaby(true);
user.getWorld().spawnEntity(new ItemEntity(user.getWorld(), pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.FEATHER, amount)));
return ActionResult.SUCCESS;
}
return ActionResult.PASS;
}
}

View File

@ -5,7 +5,6 @@ import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.text.Text;
/**
*
@ -14,13 +13,6 @@ import net.minecraft.text.Text;
*/
public interface ToolRangeable {
/**
* dummy to have a getName method that comes with the item
*
* @return the name
*/
public Text getName();
/**
* @param stack the item stack that keeps the range
* @return range of blocks to be harvested

View File

@ -8,7 +8,6 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.PickaxeItem;
import net.minecraft.item.ToolMaterial;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
@ -21,13 +20,13 @@ import net.minecraft.util.Identifier;
* @author jotty
*
*/
public class ToolSpeedpowderPickaxe extends PickaxeItem implements ToolRangeable {
public class ToolSpeedpowderPickaxe extends Item implements ToolRangeable {
public static final int[] DEFAULT_HARVEST_RANGE = new int[] { 3, 3, 3 };
private final static ToolMaterial MATERIAL = new ToolMaterial(BlockTags.INCORRECT_FOR_DIAMOND_TOOL, 800, 7.0F, 1.0F, 15, ItemTags.DIAMOND_TOOL_MATERIALS);
public ToolSpeedpowderPickaxe(Identifier identifier) {
super(MATERIAL, 7F, -3.1F, new Item.Settings().useItemPrefixedTranslationKey().registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier)));
super(new Item.Settings().pickaxe(MATERIAL, 7F, -3.1F).useItemPrefixedTranslationKey().registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier)));
}
@Override

View File

@ -36,7 +36,7 @@ public class ToolSpeedpowderShears extends ShearsItem {
@Override
public ActionResult useOnEntity(ItemStack stack, PlayerEntity user, LivingEntity entity, Hand hand) {
Vec3d pos = entity.getPos();
Integer amount = 3 + new Random().nextInt(4);
Integer amount = 1 + new Random().nextInt(4);
if (entity instanceof SheepEntity) {
SheepEntity sheep = (SheepEntity) entity;
if (sheep.isShearable()) {
@ -81,16 +81,19 @@ public class ToolSpeedpowderShears extends ShearsItem {
} else if (entity instanceof HorseEntity) {
HorseEntity horse = (HorseEntity) entity;
horse.playAmbientSound();
horse.setBaby(true);
user.getWorld().spawnEntity(new ItemEntity(user.getWorld(), pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.LEATHER, amount)));
return ActionResult.SUCCESS;
} else if (entity instanceof CowEntity) {
CowEntity cow = (CowEntity) entity;
cow.playAmbientSound();
cow.setBaby(true);
user.getWorld().spawnEntity(new ItemEntity(user.getWorld(), pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.LEATHER, amount)));
return ActionResult.SUCCESS;
} else if (entity instanceof ChickenEntity) {
ChickenEntity cow = (ChickenEntity) entity;
cow.playAmbientSound();
ChickenEntity chicken = (ChickenEntity) entity;
chicken.playAmbientSound();
chicken.setBaby(true);
user.getWorld().spawnEntity(new ItemEntity(user.getWorld(), pos.getX(), pos.getY(), pos.getZ(), new ItemStack(Items.FEATHER, amount)));
return ActionResult.SUCCESS;
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "quickiemod:block/oredeepslatespeedpowder"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "quickiemod:block/oredeepslateturquoise"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "quickiemod:block/orespeedpowder"
}
}
}

View File

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "quickiemod:block/oreturquoise"
}
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/blockquickiepowder"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/blocksalpeter"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/blockspeedpowder"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/blockstackerdown"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/blockstackereast"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/blockstackernorth"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/blockstackersouth"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/blockstackerup"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/blockstackerwest"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/blocksulphor"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/canola"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/canolabottle"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/canolabottlestack"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/canolaseed"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/canolaseed"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/carrotstack"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/copperpowder"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/copperstick"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/copperstring"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/copperstub"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/cotton"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/cottonseed"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/cottonseed"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/dirtsalpeter"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/drill"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/drilleast"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/drillnorth"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/drillsouth"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/drillwest"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/emptylavahoarder"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/itemhoarder"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/kelpstack"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/lavahoarder"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/monsterhoarder"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/oredeepslatespeedpowder"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/oredeepslatesulphor"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/oredeepslateturquoise"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/orenethersulphor"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/oresalpeter"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/oresandsalpeter"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/orespeedpowder"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/oresulphor"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/oreturquoise"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/oxidizedcopperpowder"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/quickieingot"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/quickiepowder"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/quickiepowderaxe"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/quickiepowderhoe"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/quickiepowderpickaxe"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/quickiepowdershears"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/quickiepowdershovel"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/quickiepowderwaterhoe"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/rawturquoise"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/rotten_flesh_stripes"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/salpeter"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:block/sandsalpeter"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/speedingot"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/speedpowder"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/speedpowderaxe"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/speedpowderhoe"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/speedpowderpickaxe"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/speedpowdershears"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/speedpowdershovel"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/speedpowderwaterhoe"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/stub"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/sulphor"
}
}

View File

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "quickiemod:item/turquoiseingot"
}
}

View File

@ -13,6 +13,7 @@
"item.quickiemod.quickiepowdershovel": "Eilpulverschaufel",
"item.quickiemod.quickiepowderhoe": "Eilpulverfeldhacke",
"item.quickiemod.quickiepowderwaterhoe": "bewässerte Eilpulverfeldhacke",
"item.quickiemod.quickiepowdershears": "Eilpulverschere",
"item.quickiemod.sulphor": "Schwefel",
"item.quickiemod.salpeter": "Salpeter",
"item.quickiemod.construction0": "leerer Bauplan",
@ -49,13 +50,23 @@
"item.quickiemod.oxidizedcopperpowder": "oxidiertes Kupferpulver",
"item.quickiemod.speedingot": "Fluchtpulverbarren",
"item.quickiemod.quickieingot": "Eilpulverbarren",
"item.quickiemod.copperstring": "Kupferband",
"item.quickiemod.copperpowder": "Kupferpulver",
"item.quickiemod.copperstub": "Kupferstummel",
"item.quickiemod.copperstick": "Kupferstock",
"item.quickiemod.rawturquoise": "Türkisroherz",
"item.quickiemod.turquoiseingot": "Türkisbarren",
"block.quickiemod.orenethersulphor": "Nether-Schwefel",
"block.quickiemod.oresalpeter": "Salpetererz",
"block.quickiemod.oresandsalpeter": "Salpetergestein",
"block.quickiemod.oresulphor": "Schwefelgestein",
"block.quickiemod.oredeepslatesulphor": "Schwefeltiefengestein",
"block.quickiemod.orespeedpowder": "Eilpulvererz",
"block.quickiemod.oredeepslatespeedpowder": "Eilpulvertiefengesteinerz",
"block.quickiemod.dirtsalpeter": "Salpetererde",
"block.quickiemod.sandsalpeter": "Salpetersand",
"block.quickiemod.oreturquoise": "Türkiserz",
"block.quickiemod.oredeepslateturquoise": "Türkistiefengesteinerz",
"block.quickiemod.constructionborder": "Bauplangrenzblock",
"block.quickiemod.rotateclockwise": "im Urzeigersinn Bauplandreher",
"block.quickiemod.rotatecounterclockwise": "gegen den Urzeigersinn Bauplandreher",

Some files were not shown because too many files have changed in this diff Show More