additional files for 1.16.1.1
This commit is contained in:
parent
af9a8aed29
commit
d57c833b2b
@ -0,0 +1,40 @@
|
|||||||
|
package de.jottyfan.minecraft.quickiefabric.blockentity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.block.entity.BlockEntity;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.mob.HostileEntity;
|
||||||
|
import net.minecraft.util.Tickable;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.Box;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author jotty
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class MonsterHoarderBlockEntity extends BlockEntity implements Tickable {
|
||||||
|
|
||||||
|
private float suckradius;
|
||||||
|
|
||||||
|
public MonsterHoarderBlockEntity() {
|
||||||
|
super(QuickieFabricBlockEntity.MONSTERHOARDER);
|
||||||
|
suckradius = 8f; // TODO: make it level up - able and start with 2
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tick() {
|
||||||
|
BlockPos pos = getPos();
|
||||||
|
World world = getWorld();
|
||||||
|
Box box = new Box(pos).expand(suckradius);
|
||||||
|
List<Entity> entities = world.getEntities(null, box);
|
||||||
|
for (Entity entity : entities) {
|
||||||
|
if (entity instanceof HostileEntity) {
|
||||||
|
HostileEntity mobEntity = (HostileEntity) entity;
|
||||||
|
mobEntity.setOnFireFor(90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package de.jottyfan.minecraft.quickiefabric.blocks;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import de.jottyfan.minecraft.quickiefabric.blockentity.MonsterHoarderBlockEntity;
|
||||||
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockEntityProvider;
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.block.Material;
|
||||||
|
import net.minecraft.block.entity.BlockEntity;
|
||||||
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.loot.context.LootContext.Builder;
|
||||||
|
import net.minecraft.sound.SoundCategory;
|
||||||
|
import net.minecraft.sound.SoundEvents;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.BlockView;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author jotty
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class BlockMonsterhoarder extends Block implements BlockEntityProvider {
|
||||||
|
|
||||||
|
public BlockMonsterhoarder() {
|
||||||
|
super(FabricBlockSettings.of(Material.WOOD).hardness(2.5f).lightLevel(20));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockEntity createBlockEntity(BlockView blockView) {
|
||||||
|
return new MonsterHoarderBlockEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ItemStack> getDroppedStacks(BlockState state, Builder builder) {
|
||||||
|
List<ItemStack> list = new ArrayList<>();
|
||||||
|
list.add(new ItemStack(QuickieBlocks.MONSTERHOARDER));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) {
|
||||||
|
if (!world.isClient) {
|
||||||
|
world.playSound(null, pos, SoundEvents.UI_TOAST_CHALLENGE_COMPLETE, SoundCategory.PLAYERS, 1f, 1f);
|
||||||
|
}
|
||||||
|
super.onPlaced(world, pos, state, placer, itemStack);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": {
|
||||||
|
"model": "quickiefabric:block/monsterhoarder"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "block/cube_all",
|
||||||
|
"textures": {
|
||||||
|
"all": "quickiefabric:block/monsterhoarder"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"parent": "quickiefabric:block/monsterhoarder",
|
||||||
|
"display": {
|
||||||
|
"thirdperson": {
|
||||||
|
"rotation": [ 10, -45, 170 ],
|
||||||
|
"translation": [ 0, 1.5, -2.75 ],
|
||||||
|
"scale": [ 0.375, 0.375, 0.375 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
"ooo",
|
||||||
|
"oso",
|
||||||
|
"ooo"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"o": {
|
||||||
|
"item": "quickiefabric:speedpowder"
|
||||||
|
},
|
||||||
|
"s": {
|
||||||
|
"item": "minecraft:torch"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "quickiefabric:monsterhoarder",
|
||||||
|
"count": 1
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:campfire_cooking",
|
||||||
|
"ingredient": {
|
||||||
|
"item": "minecraft:stick"
|
||||||
|
},
|
||||||
|
"result": "minecraft:torch",
|
||||||
|
"experience": 0,
|
||||||
|
"cookingtime": 50
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user