Code style changes, entities fixes
This commit is contained in:
parent
9d604b2d25
commit
44962e18b6
377 changed files with 5038 additions and 4914 deletions
|
@ -5,24 +5,28 @@ public interface BetterEndPlugin {
|
||||||
* Alloying recipes registration.
|
* Alloying recipes registration.
|
||||||
* See AlloyingRecipe.Builder for details.
|
* See AlloyingRecipe.Builder for details.
|
||||||
*/
|
*/
|
||||||
default void registerAlloyingRecipes() {}
|
default void registerAlloyingRecipes() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smithing recipes registration.
|
* Smithing recipes registration.
|
||||||
* See AnvilSmithingRecipe.Builder for details.
|
* See AnvilSmithingRecipe.Builder for details.
|
||||||
*/
|
*/
|
||||||
default void registerSmithingRecipes() {}
|
default void registerSmithingRecipes() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Additional biomes registration.
|
* Additional biomes registration.
|
||||||
* See BiomeRegistry.registerBiome for details.
|
* See BiomeRegistry.registerBiome for details.
|
||||||
*/
|
*/
|
||||||
default void registerEndBiomes() {}
|
default void registerEndBiomes() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register other mod stuff, for example, EndHammers.
|
* Register other mod stuff, for example, EndHammers.
|
||||||
*/
|
*/
|
||||||
default void registerOthers() {}
|
default void registerOthers() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void register(BetterEndPlugin plugin) {
|
public static void register(BetterEndPlugin plugin) {
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -21,6 +17,10 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndParticles;
|
import ru.betterend.registry.EndParticles;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class AncientEmeraldIceBlock extends BaseBlock {
|
public class AncientEmeraldIceBlock extends BaseBlock {
|
||||||
public AncientEmeraldIceBlock() {
|
public AncientEmeraldIceBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.BLUE_ICE).randomTicks());
|
super(FabricBlockSettings.copyOf(Blocks.BLUE_ICE).randomTicks());
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.client.color.block.BlockColor;
|
import net.minecraft.client.color.block.BlockColor;
|
||||||
|
@ -27,7 +24,8 @@ import ru.bclib.interfaces.IRenderTyped;
|
||||||
import ru.bclib.util.ColorUtil;
|
import ru.bclib.util.ColorUtil;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
import ru.betterend.registry.EndTags;
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyped, IColorProvider {
|
public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyped, IColorProvider {
|
||||||
public static final Vec3i[] COLORS;
|
public static final Vec3i[] COLORS;
|
||||||
|
@ -51,7 +49,8 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp
|
||||||
return (state, world, pos, tintIndex) -> {
|
return (state, world, pos, tintIndex) -> {
|
||||||
if (pos == null) {
|
if (pos == null) {
|
||||||
pos = BlockPos.ZERO;
|
pos = BlockPos.ZERO;
|
||||||
};
|
}
|
||||||
|
;
|
||||||
|
|
||||||
long i = (long) pos.getX() + (long) pos.getY() + (long) pos.getZ();
|
long i = (long) pos.getX() + (long) pos.getY() + (long) pos.getZ();
|
||||||
double delta = i * 0.1;
|
double delta = i * 0.1;
|
||||||
|
@ -100,7 +99,8 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp
|
||||||
return Lists.newArrayList(new ItemStack(EndItems.CRYSTAL_SHARDS, max));
|
return Lists.newArrayList(new ItemStack(EndItems.CRYSTAL_SHARDS, max));
|
||||||
}
|
}
|
||||||
count = MHelper.randRange(min, max, MHelper.RANDOM);
|
count = MHelper.randRange(min, max, MHelper.RANDOM);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
count = MHelper.randRange(MIN_DROP, MAX_DROP, MHelper.RANDOM);
|
count = MHelper.randRange(MIN_DROP, MAX_DROP, MHelper.RANDOM);
|
||||||
}
|
}
|
||||||
return Lists.newArrayList(new ItemStack(EndItems.CRYSTAL_SHARDS, count));
|
return Lists.newArrayList(new ItemStack(EndItems.CRYSTAL_SHARDS, count));
|
||||||
|
@ -109,7 +109,7 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
COLORS = new Vec3i[] {
|
COLORS = new Vec3i[]{
|
||||||
new Vec3i(247, 77, 161),
|
new Vec3i(247, 77, 161),
|
||||||
new Vec3i(120, 184, 255),
|
new Vec3i(120, 184, 255),
|
||||||
new Vec3i(120, 255, 168),
|
new Vec3i(120, 255, 168),
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.world.level.WorldGenLevel;
|
import net.minecraft.world.level.WorldGenLevel;
|
||||||
|
@ -14,6 +12,8 @@ import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||||
import ru.betterend.blocks.basis.FurBlock;
|
import ru.betterend.blocks.basis.FurBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
|
public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
|
||||||
@Override
|
@Override
|
||||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||||
|
@ -32,7 +32,7 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
|
||||||
|
|
||||||
private void placeLantern(WorldGenLevel world, BlockPos pos) {
|
private void placeLantern(WorldGenLevel world, BlockPos pos) {
|
||||||
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true));
|
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true));
|
||||||
for (Direction dir: BlocksHelper.HORIZONTAL) {
|
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||||
BlockPos p = pos.relative(dir);
|
BlockPos p = pos.relative(dir);
|
||||||
if (world.isEmptyBlock(p)) {
|
if (world.isEmptyBlock(p)) {
|
||||||
BlocksHelper.setWithoutUpdate(world, p, EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, dir));
|
BlocksHelper.setWithoutUpdate(world, p, EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, dir));
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.BlockGetter;
|
import net.minecraft.world.level.BlockGetter;
|
||||||
|
@ -18,6 +14,9 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
import ru.betterend.blocks.basis.EndPlantBlock;
|
import ru.betterend.blocks.basis.EndPlantBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class BoluxMushroomBlock extends EndPlantBlock {
|
public class BoluxMushroomBlock extends EndPlantBlock {
|
||||||
private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 9, 15);
|
private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 9, 15);
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.client.multiplayer.ClientLevel;
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -20,11 +16,14 @@ import net.minecraft.world.level.block.state.StateDefinition;
|
||||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||||
import net.minecraft.world.level.material.Fluids;
|
import net.minecraft.world.level.material.Fluids;
|
||||||
import net.minecraft.world.level.material.MaterialColor;
|
import net.minecraft.world.level.material.MaterialColor;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ru.bclib.blocks.BaseBlock;
|
import ru.bclib.blocks.BaseBlock;
|
||||||
import ru.bclib.blocks.BlockProperties;
|
import ru.bclib.blocks.BlockProperties;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class BrimstoneBlock extends BaseBlock {
|
public class BrimstoneBlock extends BaseBlock {
|
||||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
||||||
|
|
||||||
|
@ -67,7 +66,7 @@ public class BrimstoneBlock extends BaseBlock {
|
||||||
@Override
|
@Override
|
||||||
public void tick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
public void tick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
||||||
boolean deactivate = true;
|
boolean deactivate = true;
|
||||||
for (Direction dir: BlocksHelper.DIRECTIONS) {
|
for (Direction dir : BlocksHelper.DIRECTIONS) {
|
||||||
if (world.getFluidState(pos.relative(dir)).getType().equals(Fluids.WATER)) {
|
if (world.getFluidState(pos.relative(dir)).getType().equals(Fluids.WATER)) {
|
||||||
deactivate = false;
|
deactivate = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.BlockGetter;
|
import net.minecraft.world.level.BlockGetter;
|
||||||
|
@ -16,6 +13,8 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class BulbVineBlock extends BaseVineBlock {
|
public class BulbVineBlock extends BaseVineBlock {
|
||||||
public BulbVineBlock() {
|
public BulbVineBlock() {
|
||||||
super(15, true);
|
super(15, true);
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -22,6 +16,7 @@ import net.minecraft.world.level.material.Material;
|
||||||
import net.minecraft.world.level.material.MaterialColor;
|
import net.minecraft.world.level.material.MaterialColor;
|
||||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ru.bclib.client.models.BlockModelProvider;
|
import ru.bclib.client.models.BlockModelProvider;
|
||||||
import ru.bclib.client.models.ModelsHelper;
|
import ru.bclib.client.models.ModelsHelper;
|
||||||
import ru.bclib.client.render.BCLRenderLayer;
|
import ru.bclib.client.render.BCLRenderLayer;
|
||||||
|
@ -29,6 +24,9 @@ import ru.bclib.interfaces.IRenderTyped;
|
||||||
import ru.betterend.blocks.basis.EndLanternBlock;
|
import ru.betterend.blocks.basis.EndLanternBlock;
|
||||||
import ru.betterend.client.models.Patterns;
|
import ru.betterend.client.models.Patterns;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class BulbVineLanternBlock extends EndLanternBlock implements IRenderTyped, BlockModelProvider {
|
public class BulbVineLanternBlock extends EndLanternBlock implements IRenderTyped, BlockModelProvider {
|
||||||
private static final VoxelShape SHAPE_CEIL = Block.box(4, 4, 4, 12, 16, 12);
|
private static final VoxelShape SHAPE_CEIL = Block.box(4, 4, 4, 12, 16, 12);
|
||||||
private static final VoxelShape SHAPE_FLOOR = Block.box(4, 0, 4, 12, 12, 12);
|
private static final VoxelShape SHAPE_FLOOR = Block.box(4, 0, 4, 12, 12, 12);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.tags.BlockTags;
|
import net.minecraft.tags.BlockTags;
|
||||||
import net.minecraft.world.level.LevelReader;
|
import net.minecraft.world.level.LevelReader;
|
||||||
|
@ -14,6 +12,8 @@ import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class BulbVineSeedBlock extends EndPlantWithAgeBlock {
|
public class BulbVineSeedBlock extends EndPlantWithAgeBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
@ -22,6 +19,9 @@ import ru.bclib.client.render.BCLRenderLayer;
|
||||||
import ru.bclib.interfaces.IRenderTyped;
|
import ru.bclib.interfaces.IRenderTyped;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CavePumpkinBlock extends BaseBlockNotFull implements IRenderTyped {
|
public class CavePumpkinBlock extends BaseBlockNotFull implements IRenderTyped {
|
||||||
public static final BooleanProperty SMALL = BlockProperties.SMALL;
|
public static final BooleanProperty SMALL = BlockProperties.SMALL;
|
||||||
private static final VoxelShape SHAPE_SMALL;
|
private static final VoxelShape SHAPE_SMALL;
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
@ -18,6 +16,8 @@ import ru.bclib.blocks.BlockProperties;
|
||||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
|
public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
|
||||||
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 16, 12);
|
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 16, 12);
|
||||||
|
|
||||||
|
@ -45,7 +45,8 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {}
|
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||||
|
|
|
@ -1,13 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.EnumMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -23,6 +16,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||||
import net.minecraft.world.phys.shapes.Shapes;
|
import net.minecraft.world.phys.shapes.Shapes;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ru.bclib.blocks.BaseAttachedBlock;
|
import ru.bclib.blocks.BaseAttachedBlock;
|
||||||
import ru.bclib.client.models.BlockModelProvider;
|
import ru.bclib.client.models.BlockModelProvider;
|
||||||
import ru.bclib.client.models.ModelsHelper;
|
import ru.bclib.client.models.ModelsHelper;
|
||||||
|
@ -30,6 +24,10 @@ import ru.bclib.client.render.BCLRenderLayer;
|
||||||
import ru.bclib.interfaces.IRenderTyped;
|
import ru.bclib.interfaces.IRenderTyped;
|
||||||
import ru.betterend.client.models.Patterns;
|
import ru.betterend.client.models.Patterns;
|
||||||
|
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class ChandelierBlock extends BaseAttachedBlock implements IRenderTyped, BlockModelProvider {
|
public class ChandelierBlock extends BaseAttachedBlock implements IRenderTyped, BlockModelProvider {
|
||||||
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||||
|
@ -15,6 +12,9 @@ import ru.bclib.blocks.BaseBlock;
|
||||||
import ru.bclib.client.render.BCLRenderLayer;
|
import ru.bclib.client.render.BCLRenderLayer;
|
||||||
import ru.bclib.interfaces.IRenderTyped;
|
import ru.bclib.interfaces.IRenderTyped;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class DenseEmeraldIceBlock extends BaseBlock implements IRenderTyped {
|
public class DenseEmeraldIceBlock extends BaseBlock implements IRenderTyped {
|
||||||
public DenseEmeraldIceBlock() {
|
public DenseEmeraldIceBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.PACKED_ICE));
|
super(FabricBlockSettings.copyOf(Blocks.PACKED_ICE));
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -26,10 +20,15 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
import net.minecraft.world.level.storage.loot.LootContext;
|
import net.minecraft.world.level.storage.loot.LootContext;
|
||||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ru.bclib.client.models.BlockModelProvider;
|
import ru.bclib.client.models.BlockModelProvider;
|
||||||
import ru.bclib.client.render.BCLRenderLayer;
|
import ru.bclib.client.render.BCLRenderLayer;
|
||||||
import ru.bclib.interfaces.IRenderTyped;
|
import ru.bclib.interfaces.IRenderTyped;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class EmeraldIceBlock extends HalfTransparentBlock implements IRenderTyped, BlockModelProvider {
|
public class EmeraldIceBlock extends HalfTransparentBlock implements IRenderTyped, BlockModelProvider {
|
||||||
public EmeraldIceBlock() {
|
public EmeraldIceBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.ICE));
|
super(FabricBlockSettings.copyOf(Blocks.ICE));
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -37,6 +32,10 @@ import ru.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class EndLilyBlock extends EndUnderwaterPlantBlock {
|
public class EndLilyBlock extends EndUnderwaterPlantBlock {
|
||||||
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||||
private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 16, 12);
|
private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 16, 12);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.WorldGenLevel;
|
import net.minecraft.world.level.WorldGenLevel;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
@ -12,6 +10,8 @@ import ru.bclib.blocks.UnderwaterPlantWithAgeBlock;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock {
|
public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
@Override
|
@Override
|
||||||
public void grow(WorldGenLevel world, Random random, BlockPos pos) {
|
public void grow(WorldGenLevel world, Random random, BlockPos pos) {
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -21,6 +18,8 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.basis.EndPlantBlock;
|
import ru.betterend.blocks.basis.EndPlantBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class EndLotusFlowerBlock extends EndPlantBlock {
|
public class EndLotusFlowerBlock extends EndPlantBlock {
|
||||||
private static final VoxelShape SHAPE_OUTLINE = Block.box(2, 0, 2, 14, 14, 14);
|
private static final VoxelShape SHAPE_OUTLINE = Block.box(2, 0, 2, 14, 14, 14);
|
||||||
private static final VoxelShape SHAPE_COLLISION = Block.box(0, 0, 0, 16, 2, 16);
|
private static final VoxelShape SHAPE_COLLISION = Block.box(0, 0, 0, 16, 2, 16);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -14,6 +12,8 @@ import ru.bclib.blocks.UnderwaterPlantWithAgeBlock;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
@Override
|
@Override
|
||||||
public void grow(WorldGenLevel world, Random random, BlockPos pos) {
|
public void grow(WorldGenLevel world, Random random, BlockPos pos) {
|
||||||
|
@ -92,10 +92,10 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
MutableBlockPos p = new MutableBlockPos();
|
MutableBlockPos p = new MutableBlockPos();
|
||||||
BlockState leaf = EndBlocks.END_LOTUS_LEAF.defaultBlockState();
|
BlockState leaf = EndBlocks.END_LOTUS_LEAF.defaultBlockState();
|
||||||
BlocksHelper.setWithoutUpdate(world, pos, leaf.setValue(EndLotusLeafBlock.SHAPE, TripleShape.BOTTOM));
|
BlocksHelper.setWithoutUpdate(world, pos, leaf.setValue(EndLotusLeafBlock.SHAPE, TripleShape.BOTTOM));
|
||||||
for (Direction move: BlocksHelper.HORIZONTAL) {
|
for (Direction move : BlocksHelper.HORIZONTAL) {
|
||||||
BlocksHelper.setWithoutUpdate(world, p.set(pos).move(move), leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, move).setValue(EndLotusLeafBlock.SHAPE, TripleShape.MIDDLE));
|
BlocksHelper.setWithoutUpdate(world, p.set(pos).move(move), leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, move).setValue(EndLotusLeafBlock.SHAPE, TripleShape.MIDDLE));
|
||||||
}
|
}
|
||||||
for (int i = 0; i < 4; i ++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
Direction d1 = BlocksHelper.HORIZONTAL[i];
|
Direction d1 = BlocksHelper.HORIZONTAL[i];
|
||||||
Direction d2 = BlocksHelper.HORIZONTAL[(i + 1) & 3];
|
Direction d2 = BlocksHelper.HORIZONTAL[(i + 1) & 3];
|
||||||
BlocksHelper.setWithoutUpdate(world, p.set(pos).move(d1).move(d2), leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1).setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP));
|
BlocksHelper.setWithoutUpdate(world, p.set(pos).move(d1).move(d2), leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1).setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP));
|
||||||
|
@ -106,12 +106,12 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
MutableBlockPos p = new MutableBlockPos();
|
MutableBlockPos p = new MutableBlockPos();
|
||||||
p.setY(pos.getY());
|
p.setY(pos.getY());
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (int x = -1; x < 2; x ++) {
|
for (int x = -1; x < 2; x++) {
|
||||||
p.setX(pos.getX() + x);
|
p.setX(pos.getX() + x);
|
||||||
for (int z = -1; z < 2; z ++) {
|
for (int z = -1; z < 2; z++) {
|
||||||
p.setZ(pos.getZ() + z);
|
p.setZ(pos.getZ() + z);
|
||||||
if (world.isEmptyBlock(p) && !world.getFluidState(p.below()).isEmpty())
|
if (world.isEmptyBlock(p) && !world.getFluidState(p.below()).isEmpty())
|
||||||
count ++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return count == 9;
|
return count == 9;
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -32,6 +29,8 @@ import ru.bclib.client.render.BCLRenderLayer;
|
||||||
import ru.bclib.interfaces.IRenderTyped;
|
import ru.bclib.interfaces.IRenderTyped;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlock, IRenderTyped {
|
public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlock, IRenderTyped {
|
||||||
public static final EnumProperty<Direction> FACING = BlockStateProperties.FACING;
|
public static final EnumProperty<Direction> FACING = BlockStateProperties.FACING;
|
||||||
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import ru.betterend.BetterEnd;
|
import ru.betterend.BetterEnd;
|
||||||
import ru.betterend.blocks.basis.PedestalBlock;
|
import ru.betterend.blocks.basis.PedestalBlock;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class EndPedestal extends PedestalBlock {
|
public class EndPedestal extends PedestalBlock {
|
||||||
|
|
||||||
public EndPedestal(Block parent) {
|
public EndPedestal(Block parent) {
|
||||||
|
@ -21,8 +21,9 @@ public class EndPedestal extends PedestalBlock {
|
||||||
String name = blockId.getPath();
|
String name = blockId.getPath();
|
||||||
return new HashMap<String, String>() {
|
return new HashMap<String, String>() {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
{
|
{
|
||||||
put("%mod%", BetterEnd.MOD_ID );
|
put("%mod%", BetterEnd.MOD_ID);
|
||||||
put("%top%", name + "_polished");
|
put("%top%", name + "_polished");
|
||||||
put("%base%", name + "_polished");
|
put("%base%", name + "_polished");
|
||||||
put("%pillar%", name + "_pillar_side");
|
put("%pillar%", name + "_pillar_side");
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -40,6 +36,10 @@ import ru.betterend.registry.EndParticles;
|
||||||
import ru.betterend.registry.EndPortals;
|
import ru.betterend.registry.EndPortals;
|
||||||
import ru.betterend.rituals.EternalRitual;
|
import ru.betterend.rituals.EternalRitual;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, IColorProvider {
|
public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, IColorProvider {
|
||||||
public static final IntegerProperty PORTAL = EndBlockProperties.PORTAL;
|
public static final IntegerProperty PORTAL = EndBlockProperties.PORTAL;
|
||||||
|
|
||||||
|
@ -66,7 +66,8 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
|
||||||
int k = random.nextInt(2) * 2 - 1;
|
int k = random.nextInt(2) * 2 - 1;
|
||||||
if (!world.getBlockState(pos.west()).is(this) && !world.getBlockState(pos.east()).is(this)) {
|
if (!world.getBlockState(pos.west()).is(this) && !world.getBlockState(pos.east()).is(this)) {
|
||||||
x = pos.getX() + 0.5D + 0.25D * k;
|
x = pos.getX() + 0.5D + 0.25D * k;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
z = pos.getZ() + 0.5D + 0.25D * k;
|
z = pos.getZ() + 0.5D + 0.25D * k;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +75,8 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) {}
|
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
||||||
|
@ -95,7 +97,8 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
|
||||||
if (entity instanceof ServerPlayer && ((ServerPlayer) entity).isCreative()) {
|
if (entity instanceof ServerPlayer && ((ServerPlayer) entity).isCreative()) {
|
||||||
((ServerPlayer) entity).teleportTo(destination, exitPos.getX() + 0.5, exitPos.getY(),
|
((ServerPlayer) entity).teleportTo(destination, exitPos.getX() + 0.5, exitPos.getY(),
|
||||||
exitPos.getZ() + 0.5, entity.getYRot(), entity.getXRot());
|
exitPos.getZ() + 0.5, entity.getYRot(), entity.getXRot());
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
((TeleportingEntity) entity).be_setExitPos(exitPos);
|
((TeleportingEntity) entity).be_setExitPos(exitPos);
|
||||||
Optional<Entity> teleported = Optional.ofNullable(entity.changeDimension(destination));
|
Optional<Entity> teleported = Optional.ofNullable(entity.changeDimension(destination));
|
||||||
teleported.ifPresent(Entity::setPortalCooldown);
|
teleported.ifPresent(Entity::setPortalCooldown);
|
||||||
|
@ -159,11 +162,14 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
|
||||||
BlockState down = world.getBlockState(pos.below());
|
BlockState down = world.getBlockState(pos.below());
|
||||||
if (down.is(this)) {
|
if (down.is(this)) {
|
||||||
return findCenter(world, pos.move(Direction.DOWN), axis, step);
|
return findCenter(world, pos.move(Direction.DOWN), axis, step);
|
||||||
} else if (right.is(this) && left.is(this)) {
|
}
|
||||||
|
else if (right.is(this) && left.is(this)) {
|
||||||
return pos;
|
return pos;
|
||||||
} else if (right.is(this)) {
|
}
|
||||||
|
else if (right.is(this)) {
|
||||||
return findCenter(world, pos.move(rightDir), axis, ++step);
|
return findCenter(world, pos.move(rightDir), axis, ++step);
|
||||||
} else if (left.is(this)) {
|
}
|
||||||
|
else if (left.is(this)) {
|
||||||
return findCenter(world, pos.move(leftDir), axis, ++step);
|
return findCenter(world, pos.move(leftDir), axis, ++step);
|
||||||
}
|
}
|
||||||
return pos;
|
return pos;
|
||||||
|
|
|
@ -16,7 +16,12 @@ import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.*;
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.HorizontalDirectionalBlock;
|
||||||
|
import net.minecraft.world.level.block.Mirror;
|
||||||
|
import net.minecraft.world.level.block.RenderShape;
|
||||||
|
import net.minecraft.world.level.block.Rotation;
|
||||||
|
import net.minecraft.world.level.block.SoundType;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
|
@ -56,7 +61,8 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
||||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||||
if (world.isClientSide) {
|
if (world.isClientSide) {
|
||||||
return InteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
this.openScreen(world, pos, player);
|
this.openScreen(world, pos, player);
|
||||||
return InteractionResult.CONSUME;
|
return InteractionResult.CONSUME;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -16,6 +13,9 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.storage.loot.LootContext;
|
import net.minecraft.world.level.storage.loot.LootContext;
|
||||||
import ru.bclib.util.ColorUtil;
|
import ru.bclib.util.ColorUtil;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class EndstoneDustBlock extends FallingBlock {
|
public class EndstoneDustBlock extends FallingBlock {
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
private static final int COLOR = ColorUtil.color(226, 239, 168);
|
private static final int COLOR = ColorUtil.color(226, 239, 168);
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
|
@ -28,6 +25,8 @@ import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndPortals;
|
import ru.betterend.registry.EndPortals;
|
||||||
import ru.betterend.rituals.EternalRitual;
|
import ru.betterend.rituals.EternalRitual;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class EternalPedestal extends PedestalBlock {
|
public class EternalPedestal extends PedestalBlock {
|
||||||
public static final BooleanProperty ACTIVATED = EndBlockProperties.ACTIVE;
|
public static final BooleanProperty ACTIVATED = EndBlockProperties.ACTIVE;
|
||||||
|
|
||||||
|
@ -50,21 +49,24 @@ public class EternalPedestal extends PedestalBlock {
|
||||||
int portalId;
|
int portalId;
|
||||||
if (targetWorld != null) {
|
if (targetWorld != null) {
|
||||||
portalId = EndPortals.getPortalIdByWorld(targetWorld);
|
portalId = EndPortals.getPortalIdByWorld(targetWorld);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
portalId = EndPortals.getPortalIdByWorld(EndPortals.OVERWORLD_ID);
|
portalId = EndPortals.getPortalIdByWorld(EndPortals.OVERWORLD_ID);
|
||||||
}
|
}
|
||||||
ritual.disablePortal(portalId);
|
ritual.disablePortal(portalId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
world.setBlockAndUpdate(pos, updatedState.setValue(ACTIVATED, false).setValue(HAS_LIGHT, false));
|
world.setBlockAndUpdate(pos, updatedState.setValue(ACTIVATED, false).setValue(HAS_LIGHT, false));
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
ItemStack itemStack = pedestal.getItem(0);
|
ItemStack itemStack = pedestal.getItem(0);
|
||||||
ResourceLocation id = Registry.ITEM.getKey(itemStack.getItem());
|
ResourceLocation id = Registry.ITEM.getKey(itemStack.getItem());
|
||||||
if (EndPortals.isAvailableItem(id)) {
|
if (EndPortals.isAvailableItem(id)) {
|
||||||
world.setBlockAndUpdate(pos, updatedState.setValue(ACTIVATED, true).setValue(HAS_LIGHT, true));
|
world.setBlockAndUpdate(pos, updatedState.setValue(ACTIVATED, true).setValue(HAS_LIGHT, true));
|
||||||
if (pedestal.hasRitual()) {
|
if (pedestal.hasRitual()) {
|
||||||
pedestal.getRitual().checkStructure();
|
pedestal.getRitual().checkStructure();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
EternalRitual ritual = new EternalRitual(world, pos);
|
EternalRitual ritual = new EternalRitual(world, pos);
|
||||||
ritual.checkStructure();
|
ritual.checkStructure();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.EnumMap;
|
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -19,6 +16,8 @@ import ru.bclib.blocks.BaseAttachedBlock;
|
||||||
import ru.bclib.client.render.BCLRenderLayer;
|
import ru.bclib.client.render.BCLRenderLayer;
|
||||||
import ru.bclib.interfaces.IRenderTyped;
|
import ru.bclib.interfaces.IRenderTyped;
|
||||||
|
|
||||||
|
import java.util.EnumMap;
|
||||||
|
|
||||||
public class FilaluxWingsBlock extends BaseAttachedBlock implements IRenderTyped {
|
public class FilaluxWingsBlock extends BaseAttachedBlock implements IRenderTyped {
|
||||||
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -21,6 +18,8 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
import ru.bclib.interfaces.ISpetialItem;
|
import ru.bclib.interfaces.ISpetialItem;
|
||||||
import ru.betterend.blocks.basis.EndPlantBlock;
|
import ru.betterend.blocks.basis.EndPlantBlock;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class FlamaeaBlock extends EndPlantBlock implements ISpetialItem {
|
public class FlamaeaBlock extends EndPlantBlock implements ISpetialItem {
|
||||||
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 1, 16);
|
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 1, 16);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -20,6 +18,8 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock {
|
public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock {
|
||||||
|
|
||||||
public GlowingPillarSeedBlock() {
|
public GlowingPillarSeedBlock() {
|
||||||
|
@ -44,14 +44,15 @@ public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock {
|
||||||
BlockState roots = EndBlocks.GLOWING_PILLAR_ROOTS.defaultBlockState();
|
BlockState roots = EndBlocks.GLOWING_PILLAR_ROOTS.defaultBlockState();
|
||||||
if (height < 2) {
|
if (height < 2) {
|
||||||
BlocksHelper.setWithUpdate(world, mut, roots.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE));
|
BlocksHelper.setWithUpdate(world, mut, roots.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE));
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
BlocksHelper.setWithUpdate(world, mut, roots.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM));
|
BlocksHelper.setWithUpdate(world, mut, roots.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM));
|
||||||
mut.move(Direction.UP);
|
mut.move(Direction.UP);
|
||||||
BlocksHelper.setWithUpdate(world, mut, roots.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP));
|
BlocksHelper.setWithUpdate(world, mut, roots.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP));
|
||||||
}
|
}
|
||||||
mut.move(Direction.UP);
|
mut.move(Direction.UP);
|
||||||
BlocksHelper.setWithUpdate(world, mut, EndBlocks.GLOWING_PILLAR_LUMINOPHOR.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true));
|
BlocksHelper.setWithUpdate(world, mut, EndBlocks.GLOWING_PILLAR_LUMINOPHOR.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true));
|
||||||
for (Direction dir: BlocksHelper.DIRECTIONS) {
|
for (Direction dir : BlocksHelper.DIRECTIONS) {
|
||||||
pos = mut.relative(dir);
|
pos = mut.relative(dir);
|
||||||
if (world.isEmptyBlock(pos)) {
|
if (world.isEmptyBlock(pos)) {
|
||||||
BlocksHelper.setWithUpdate(world, pos, EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState().setValue(BlockStateProperties.FACING, dir));
|
BlocksHelper.setWithUpdate(world, pos, EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState().setValue(BlockStateProperties.FACING, dir));
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.client.color.block.BlockColor;
|
import net.minecraft.client.color.block.BlockColor;
|
||||||
|
@ -30,6 +26,9 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class HelixTreeLeavesBlock extends BaseBlock implements IColorProvider {
|
public class HelixTreeLeavesBlock extends BaseBlock implements IColorProvider {
|
||||||
public static final IntegerProperty COLOR = EndBlockProperties.COLOR;
|
public static final IntegerProperty COLOR = EndBlockProperties.COLOR;
|
||||||
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
|
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -29,6 +24,10 @@ import ru.betterend.blocks.EndBlockProperties.HydraluxShape;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class HydraluxBlock extends UnderwaterPlantBlock {
|
public class HydraluxBlock extends UnderwaterPlantBlock {
|
||||||
|
|
||||||
public static final EnumProperty<HydraluxShape> SHAPE = EndBlockProperties.HYDRALUX_SHAPE;
|
public static final EnumProperty<HydraluxShape> SHAPE = EndBlockProperties.HYDRALUX_SHAPE;
|
||||||
|
|
|
@ -27,5 +27,6 @@ public class HydraluxPetalBlock extends BaseBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fallOn(Level level, BlockState blockState, BlockPos blockPos, Entity entity, float f) {}
|
public void fallOn(Level level, BlockState blockState, BlockPos blockPos, Entity entity, float f) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -12,11 +8,14 @@ import net.minecraft.client.color.item.ItemColor;
|
||||||
import net.minecraft.client.renderer.block.model.BlockModel;
|
import net.minecraft.client.renderer.block.model.BlockModel;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ru.bclib.client.models.ModelsHelper;
|
import ru.bclib.client.models.ModelsHelper;
|
||||||
import ru.bclib.interfaces.IColorProvider;
|
import ru.bclib.interfaces.IColorProvider;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.client.models.Patterns;
|
import ru.betterend.client.models.Patterns;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class HydraluxPetalColoredBlock extends HydraluxPetalBlock implements IColorProvider {
|
public class HydraluxPetalColoredBlock extends HydraluxPetalBlock implements IColorProvider {
|
||||||
public HydraluxPetalColoredBlock(FabricBlockSettings settings) {
|
public HydraluxPetalColoredBlock(FabricBlockSettings settings) {
|
||||||
super(settings);
|
super(settings);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||||
import net.minecraft.world.level.WorldGenLevel;
|
import net.minecraft.world.level.WorldGenLevel;
|
||||||
|
@ -13,6 +11,8 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.EndBlockProperties.HydraluxShape;
|
import ru.betterend.blocks.EndBlockProperties.HydraluxShape;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock {
|
public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -36,6 +32,7 @@ import net.minecraft.world.level.material.Fluids;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ru.bclib.blocks.BaseBlockNotFull;
|
import ru.bclib.blocks.BaseBlockNotFull;
|
||||||
import ru.bclib.blocks.BlockProperties;
|
import ru.bclib.blocks.BlockProperties;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
|
@ -43,6 +40,8 @@ import ru.betterend.blocks.entities.BlockEntityHydrothermalVent;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndParticles;
|
import ru.betterend.registry.EndParticles;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlock, LiquidBlockContainer, SimpleWaterloggedBlock {
|
public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlock, LiquidBlockContainer, SimpleWaterloggedBlock {
|
||||||
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
||||||
|
@ -124,7 +123,7 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
||||||
@Override
|
@Override
|
||||||
public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {
|
public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {
|
||||||
if (world instanceof ServerLevel && state.getValue(WATERLOGGED) && world.getBlockState(pos.above()).is(Blocks.WATER)) {
|
if (world instanceof ServerLevel && state.getValue(WATERLOGGED) && world.getBlockState(pos.above()).is(Blocks.WATER)) {
|
||||||
tick(state,(ServerLevel) world, pos, world.random);
|
tick(state, (ServerLevel) world, pos, world.random);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,8 @@ public class InfusionPedestal extends PedestalBlock {
|
||||||
ritual.configure();
|
ritual.configure();
|
||||||
}
|
}
|
||||||
pedestal.getRitual().checkRecipe();
|
pedestal.getRitual().checkRecipe();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
InfusionRitual ritual = new InfusionRitual(pedestal, world, pos);
|
InfusionRitual ritual = new InfusionRitual(pedestal, world, pos);
|
||||||
pedestal.linkRitual(ritual);
|
pedestal.linkRitual(ritual);
|
||||||
ritual.checkRecipe();
|
ritual.checkRecipe();
|
||||||
|
@ -57,7 +58,7 @@ public class InfusionPedestal extends PedestalBlock {
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
||||||
if (state.is(this)) {
|
if (state.is(this)) {
|
||||||
switch(state.getValue(STATE)) {
|
switch (state.getValue(STATE)) {
|
||||||
case PEDESTAL_TOP: {
|
case PEDESTAL_TOP: {
|
||||||
return SHAPE_PEDESTAL_TOP;
|
return SHAPE_PEDESTAL_TOP;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -25,6 +19,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.block.state.StateDefinition;
|
import net.minecraft.world.level.block.state.StateDefinition;
|
||||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||||
import net.minecraft.world.level.storage.loot.LootContext;
|
import net.minecraft.world.level.storage.loot.LootContext;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ru.bclib.client.models.BlockModelProvider;
|
import ru.bclib.client.models.BlockModelProvider;
|
||||||
import ru.bclib.client.models.ModelsHelper;
|
import ru.bclib.client.models.ModelsHelper;
|
||||||
import ru.bclib.client.render.BCLRenderLayer;
|
import ru.bclib.client.render.BCLRenderLayer;
|
||||||
|
@ -35,6 +30,9 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.client.models.Patterns;
|
import ru.betterend.client.models.Patterns;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class JellyshroomCapBlock extends SlimeBlock implements IRenderTyped, BlockModelProvider, IColorProvider {
|
public class JellyshroomCapBlock extends SlimeBlock implements IRenderTyped, BlockModelProvider, IColorProvider {
|
||||||
public static final IntegerProperty COLOR = EndBlockProperties.COLOR;
|
public static final IntegerProperty COLOR = EndBlockProperties.COLOR;
|
||||||
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
|
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
@ -21,6 +18,9 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.basis.EndPlantBlock;
|
import ru.betterend.blocks.basis.EndPlantBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class LanceleafBlock extends EndPlantBlock {
|
public class LanceleafBlock extends EndPlantBlock {
|
||||||
|
|
||||||
public static final EnumProperty<PentaShape> SHAPE = BlockProperties.PENTA_SHAPE;
|
public static final EnumProperty<PentaShape> SHAPE = BlockProperties.PENTA_SHAPE;
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -15,6 +13,8 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class LanceleafSeedBlock extends EndPlantWithAgeBlock {
|
public class LanceleafSeedBlock extends EndPlantWithAgeBlock {
|
||||||
@Override
|
@Override
|
||||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -22,6 +20,8 @@ import ru.bclib.blocks.BlockProperties.TripleShape;
|
||||||
import ru.betterend.blocks.basis.EndPlantBlock;
|
import ru.betterend.blocks.basis.EndPlantBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class LargeAmaranitaBlock extends EndPlantBlock {
|
public class LargeAmaranitaBlock extends EndPlantBlock {
|
||||||
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||||
private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 14, 12);
|
private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 14, 12);
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -31,6 +28,9 @@ import ru.betterend.blocks.EndBlockProperties.LumecornShape;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class LumecornBlock extends BaseBlockNotFull implements IRenderTyped {
|
public class LumecornBlock extends BaseBlockNotFull implements IRenderTyped {
|
||||||
public static final EnumProperty<LumecornShape> SHAPE = EnumProperty.create("shape", LumecornShape.class);
|
public static final EnumProperty<LumecornShape> SHAPE = EnumProperty.create("shape", LumecornShape.class);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.WorldGenLevel;
|
import net.minecraft.world.level.WorldGenLevel;
|
||||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||||
|
@ -11,6 +9,8 @@ import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class LumecornSeedBlock extends EndPlantWithAgeBlock {
|
public class LumecornSeedBlock extends EndPlantWithAgeBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Queue;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -17,13 +14,14 @@ import net.minecraft.world.level.block.LiquidBlock;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.material.FluidState;
|
import net.minecraft.world.level.material.FluidState;
|
||||||
import net.minecraft.world.level.material.Fluids;
|
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
import ru.bclib.blocks.BaseBlockNotFull;
|
import ru.bclib.blocks.BaseBlockNotFull;
|
||||||
import ru.bclib.client.render.BCLRenderLayer;
|
import ru.bclib.client.render.BCLRenderLayer;
|
||||||
import ru.bclib.interfaces.IRenderTyped;
|
import ru.bclib.interfaces.IRenderTyped;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Queue;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class MengerSpongeBlock extends BaseBlockNotFull implements IRenderTyped {
|
public class MengerSpongeBlock extends BaseBlockNotFull implements IRenderTyped {
|
||||||
public MengerSpongeBlock() {
|
public MengerSpongeBlock() {
|
||||||
|
@ -66,13 +64,15 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements IRenderTyped
|
||||||
if (j < 6) {
|
if (j < 6) {
|
||||||
queue.add(new Tuple<>(blockPos2, j + 1));
|
queue.add(new Tuple<>(blockPos2, j + 1));
|
||||||
}
|
}
|
||||||
} else if (blockState.getBlock() instanceof LiquidBlock) {
|
}
|
||||||
|
else if (blockState.getBlock() instanceof LiquidBlock) {
|
||||||
world.setBlock(blockPos2, Blocks.AIR.defaultBlockState(), 3);
|
world.setBlock(blockPos2, Blocks.AIR.defaultBlockState(), 3);
|
||||||
++i;
|
++i;
|
||||||
if (j < 6) {
|
if (j < 6) {
|
||||||
queue.add(new Tuple<>(blockPos2, j + 1));
|
queue.add(new Tuple<>(blockPos2, j + 1));
|
||||||
}
|
}
|
||||||
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
|
}
|
||||||
|
else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
|
||||||
BlockEntity blockEntity = blockState.hasBlockEntity() ? world.getBlockEntity(blockPos2) : null;
|
BlockEntity blockEntity = blockState.hasBlockEntity() ? world.getBlockEntity(blockPos2) : null;
|
||||||
dropResources(blockState, world, blockPos2, blockEntity);
|
dropResources(blockState, world, blockPos2, blockEntity);
|
||||||
world.setBlock(blockPos2, Blocks.AIR.defaultBlockState(), 3);
|
world.setBlock(blockPos2, Blocks.AIR.defaultBlockState(), 3);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -25,6 +23,8 @@ import ru.bclib.interfaces.IRenderTyped;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class MengerSpongeWetBlock extends BaseBlockNotFull implements IRenderTyped {
|
public class MengerSpongeWetBlock extends BaseBlockNotFull implements IRenderTyped {
|
||||||
public MengerSpongeWetBlock() {
|
public MengerSpongeWetBlock() {
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -21,6 +17,10 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||||
import ru.bclib.blocks.BaseRotatedPillarBlock;
|
import ru.bclib.blocks.BaseRotatedPillarBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class MossyDragonBoneBlock extends BaseRotatedPillarBlock {
|
public class MossyDragonBoneBlock extends BaseRotatedPillarBlock {
|
||||||
public MossyDragonBoneBlock() {
|
public MossyDragonBoneBlock() {
|
||||||
|
@ -49,9 +49,11 @@ public class MossyDragonBoneBlock extends BaseRotatedPillarBlock {
|
||||||
BlockState blockState = worldView.getBlockState(blockPos);
|
BlockState blockState = worldView.getBlockState(blockPos);
|
||||||
if (blockState.is(Blocks.SNOW) && blockState.getValue(SnowLayerBlock.LAYERS) == 1) {
|
if (blockState.is(Blocks.SNOW) && blockState.getValue(SnowLayerBlock.LAYERS) == 1) {
|
||||||
return true;
|
return true;
|
||||||
} else if (blockState.getFluidState().getAmount() == 8) {
|
}
|
||||||
|
else if (blockState.getFluidState().getAmount() == 8) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
int i = LayerLightEngine.getLightBlockInto(worldView, state, pos, blockState, blockPos, Direction.UP, blockState.getLightBlock(worldView, blockPos));
|
int i = LayerLightEngine.getLightBlockInto(worldView, state, pos, blockState, blockPos, Direction.UP, blockState.getLightBlock(worldView, blockPos));
|
||||||
return i < 5;
|
return i < 5;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -20,6 +16,10 @@ import net.minecraft.world.level.storage.loot.LootContext;
|
||||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||||
import ru.bclib.blocks.BaseBlock;
|
import ru.bclib.blocks.BaseBlock;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class MossyObsidian extends BaseBlock {
|
public class MossyObsidian extends BaseBlock {
|
||||||
public MossyObsidian() {
|
public MossyObsidian() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.OBSIDIAN).hardness(3).randomTicks());
|
super(FabricBlockSettings.copyOf(Blocks.OBSIDIAN).hardness(3).randomTicks());
|
||||||
|
@ -44,11 +44,13 @@ public class MossyObsidian extends BaseBlock {
|
||||||
public boolean canSurvive(BlockState state, LevelReader worldView, BlockPos pos) {
|
public boolean canSurvive(BlockState state, LevelReader worldView, BlockPos pos) {
|
||||||
BlockPos blockPos = pos.above();
|
BlockPos blockPos = pos.above();
|
||||||
BlockState blockState = worldView.getBlockState(blockPos);
|
BlockState blockState = worldView.getBlockState(blockPos);
|
||||||
if (blockState.is(Blocks.SNOW) && (Integer)blockState.getValue(SnowLayerBlock.LAYERS) == 1) {
|
if (blockState.is(Blocks.SNOW) && (Integer) blockState.getValue(SnowLayerBlock.LAYERS) == 1) {
|
||||||
return true;
|
return true;
|
||||||
} else if (blockState.getFluidState().getAmount() == 8) {
|
}
|
||||||
|
else if (blockState.getFluidState().getAmount() == 8) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
int i = LayerLightEngine.getLightBlockInto(worldView, state, pos, blockState, blockPos, Direction.UP, blockState.getLightBlock(worldView, blockPos));
|
int i = LayerLightEngine.getLightBlockInto(worldView, state, pos, blockState, blockPos, Direction.UP, blockState.getLightBlock(worldView, blockPos));
|
||||||
return i < 5;
|
return i < 5;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -17,6 +15,8 @@ import net.minecraft.world.level.pathfinder.PathComputationType;
|
||||||
import ru.betterend.blocks.basis.EndPlantBlock;
|
import ru.betterend.blocks.basis.EndPlantBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class MurkweedBlock extends EndPlantBlock {
|
public class MurkweedBlock extends EndPlantBlock {
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.damagesource.DamageSource;
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
@ -23,6 +20,8 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.basis.EndPlantBlock;
|
import ru.betterend.blocks.basis.EndPlantBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class NeedlegrassBlock extends EndPlantBlock {
|
public class NeedlegrassBlock extends EndPlantBlock {
|
||||||
@Override
|
@Override
|
||||||
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.EnumMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||||
|
@ -48,6 +43,10 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.EndBlockProperties.CactusBottom;
|
import ru.betterend.blocks.EndBlockProperties.CactusBottom;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, IRenderTyped {
|
public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, IRenderTyped {
|
||||||
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||||
|
@ -273,7 +272,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
|
||||||
while (iterState.is(this) && startDir.getAxis().isVertical()) {
|
while (iterState.is(this) && startDir.getAxis().isVertical()) {
|
||||||
startDir = iterState.getValue(FACING);
|
startDir = iterState.getValue(FACING);
|
||||||
if (lastDir == null) {
|
if (lastDir == null) {
|
||||||
for (Direction side: BlocksHelper.HORIZONTAL) {
|
for (Direction side : BlocksHelper.HORIZONTAL) {
|
||||||
BlockState sideState = world.getBlockState(iterPos.relative(side));
|
BlockState sideState = world.getBlockState(iterPos.relative(side));
|
||||||
if (sideState.is(this)) {
|
if (sideState.is(this)) {
|
||||||
Direction sideDir = sideState.getValue(FACING);
|
Direction sideDir = sideState.getValue(FACING);
|
||||||
|
@ -319,7 +318,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dir = state.getValue(FACING).getOpposite();
|
dir = state.getValue(FACING).getOpposite();
|
||||||
length ++;
|
length++;
|
||||||
}
|
}
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
@ -338,7 +337,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
|
||||||
if (dir.getStepY() != 0) {
|
if (dir.getStepY() != 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
count ++;
|
count++;
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import ru.betterend.blocks.basis.PedestalBlock;
|
import ru.betterend.blocks.basis.PedestalBlock;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class PedestalVanilla extends PedestalBlock {
|
public class PedestalVanilla extends PedestalBlock {
|
||||||
|
|
||||||
public PedestalVanilla(Block parent) {
|
public PedestalVanilla(Block parent) {
|
||||||
|
@ -20,8 +20,9 @@ public class PedestalVanilla extends PedestalBlock {
|
||||||
String name = blockId.getPath().replace("_block", "");
|
String name = blockId.getPath().replace("_block", "");
|
||||||
return new HashMap<String, String>() {
|
return new HashMap<String, String>() {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
{
|
{
|
||||||
put("%mod%", blockId.getNamespace() );
|
put("%mod%", blockId.getNamespace());
|
||||||
put("%top%", "polished_" + name);
|
put("%top%", "polished_" + name);
|
||||||
put("%base%", "polished_" + name);
|
put("%base%", "polished_" + name);
|
||||||
put("%pillar%", name + "_pillar");
|
put("%pillar%", name + "_pillar");
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -19,6 +17,8 @@ import net.minecraft.world.phys.shapes.CollisionContext;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
import ru.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
import ru.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class PondAnemoneBlock extends EndUnderwaterPlantBlock {
|
public class PondAnemoneBlock extends EndUnderwaterPlantBlock {
|
||||||
private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14);
|
private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14);
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.client.color.block.BlockColor;
|
import net.minecraft.client.color.block.BlockColor;
|
||||||
import net.minecraft.client.color.item.ItemColor;
|
import net.minecraft.client.color.item.ItemColor;
|
||||||
|
@ -35,6 +30,7 @@ import net.minecraft.world.level.storage.loot.LootContext;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ru.bclib.blocks.BaseBlock;
|
import ru.bclib.blocks.BaseBlock;
|
||||||
import ru.bclib.blocks.BlockProperties;
|
import ru.bclib.blocks.BlockProperties;
|
||||||
import ru.bclib.blocks.BlockProperties.TripleShape;
|
import ru.bclib.blocks.BlockProperties.TripleShape;
|
||||||
|
@ -47,6 +43,8 @@ import ru.betterend.particle.InfusionParticleType;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class RespawnObeliskBlock extends BaseBlock implements IColorProvider, IRenderTyped {
|
public class RespawnObeliskBlock extends BaseBlock implements IColorProvider, IRenderTyped {
|
||||||
private static final VoxelShape VOXEL_SHAPE_BOTTOM = Block.box(1, 0, 1, 15, 16, 15);
|
private static final VoxelShape VOXEL_SHAPE_BOTTOM = Block.box(1, 0, 1, 15, 16, 15);
|
||||||
private static final VoxelShape VOXEL_SHAPE_MIDDLE_TOP = Block.box(2, 0, 2, 14, 16, 14);
|
private static final VoxelShape VOXEL_SHAPE_MIDDLE_TOP = Block.box(2, 0, 2, 14, 16, 14);
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Explosion;
|
import net.minecraft.world.level.Explosion;
|
||||||
|
@ -18,6 +15,8 @@ import ru.bclib.blocks.BlockProperties;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class RunedFlavolite extends BaseBlock {
|
public class RunedFlavolite extends BaseBlock {
|
||||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -11,6 +9,8 @@ import net.minecraft.world.level.material.MaterialColor;
|
||||||
import ru.betterend.blocks.basis.EndTerrainBlock;
|
import ru.betterend.blocks.basis.EndTerrainBlock;
|
||||||
import ru.betterend.registry.EndParticles;
|
import ru.betterend.registry.EndParticles;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class ShadowGrassBlock extends EndTerrainBlock {
|
public class ShadowGrassBlock extends EndTerrainBlock {
|
||||||
public ShadowGrassBlock() {
|
public ShadowGrassBlock() {
|
||||||
super(MaterialColor.COLOR_BLACK);
|
super(MaterialColor.COLOR_BLACK);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -36,6 +34,8 @@ import ru.betterend.entity.SilkMothEntity;
|
||||||
import ru.betterend.registry.EndEntities;
|
import ru.betterend.registry.EndEntities;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class SilkMothHiveBlock extends BaseBlock {
|
public class SilkMothHiveBlock extends BaseBlock {
|
||||||
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
|
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||||
public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS;
|
public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS;
|
||||||
|
@ -73,7 +73,9 @@ public class SilkMothHiveBlock extends BaseBlock {
|
||||||
if (!world.getBlockState(spawn).isAir()) {
|
if (!world.getBlockState(spawn).isAir()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int count = world.getEntities(EndEntities.SILK_MOTH, new AABB(pos).inflate(16), (entity) -> { return true; }).size();
|
int count = world.getEntities(EndEntities.SILK_MOTH, new AABB(pos).inflate(16), (entity) -> {
|
||||||
|
return true;
|
||||||
|
}).size();
|
||||||
if (count > 6) {
|
if (count > 6) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -48,6 +44,10 @@ import ru.betterend.entity.SilkMothEntity;
|
||||||
import ru.betterend.registry.EndEntities;
|
import ru.betterend.registry.EndEntities;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class SilkMothNestBlock extends BaseBlock implements IRenderTyped {
|
public class SilkMothNestBlock extends BaseBlock implements IRenderTyped {
|
||||||
public static final BooleanProperty ACTIVE = EndBlockProperties.ACTIVE;
|
public static final BooleanProperty ACTIVE = EndBlockProperties.ACTIVE;
|
||||||
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
|
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||||
|
@ -134,7 +134,9 @@ public class SilkMothNestBlock extends BaseBlock implements IRenderTyped {
|
||||||
if (!world.getBlockState(spawn).isAir()) {
|
if (!world.getBlockState(spawn).isAir()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int count = world.getEntities(EndEntities.SILK_MOTH, new AABB(pos).inflate(16), (entity) -> { return true; }).size();
|
int count = world.getEntities(EndEntities.SILK_MOTH, new AABB(pos).inflate(16), (entity) -> {
|
||||||
|
return true;
|
||||||
|
}).size();
|
||||||
if (count > 6) {
|
if (count > 6) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.EnumMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -37,6 +32,10 @@ import ru.bclib.interfaces.IRenderTyped;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
|
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderTyped, BonemealableBlock {
|
public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderTyped, BonemealableBlock {
|
||||||
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.EnumMap;
|
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -32,6 +29,8 @@ import ru.bclib.blocks.BaseAttachedBlock;
|
||||||
import ru.bclib.client.render.BCLRenderLayer;
|
import ru.bclib.client.render.BCLRenderLayer;
|
||||||
import ru.bclib.interfaces.IRenderTyped;
|
import ru.bclib.interfaces.IRenderTyped;
|
||||||
|
|
||||||
|
import java.util.EnumMap;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements IRenderTyped, SimpleWaterloggedBlock, LiquidBlockContainer {
|
public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements IRenderTyped, SimpleWaterloggedBlock, LiquidBlockContainer {
|
||||||
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.EnumMap;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -41,6 +36,10 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class SulphurCrystalBlock extends BaseAttachedBlock implements IRenderTyped, SimpleWaterloggedBlock, LiquidBlockContainer {
|
public class SulphurCrystalBlock extends BaseAttachedBlock implements IRenderTyped, SimpleWaterloggedBlock, LiquidBlockContainer {
|
||||||
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.client.color.block.BlockColor;
|
import net.minecraft.client.color.block.BlockColor;
|
||||||
|
@ -18,6 +16,8 @@ import ru.bclib.util.ColorUtil;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.registry.EndParticles;
|
import ru.betterend.registry.EndParticles;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class TenaneaFlowersBlock extends BaseVineBlock implements IColorProvider {
|
public class TenaneaFlowersBlock extends BaseVineBlock implements IColorProvider {
|
||||||
public static final Vec3i[] COLORS;
|
public static final Vec3i[] COLORS;
|
||||||
|
|
||||||
|
@ -30,7 +30,8 @@ public class TenaneaFlowersBlock extends BaseVineBlock implements IColorProvider
|
||||||
return (state, world, pos, tintIndex) -> {
|
return (state, world, pos, tintIndex) -> {
|
||||||
if (pos == null) {
|
if (pos == null) {
|
||||||
pos = BlockPos.ZERO;
|
pos = BlockPos.ZERO;
|
||||||
};
|
}
|
||||||
|
;
|
||||||
long i = (MHelper.getRandom(pos.getX(), pos.getZ()) & 63) + pos.getY();
|
long i = (MHelper.getRandom(pos.getX(), pos.getZ()) & 63) + pos.getY();
|
||||||
double delta = i * 0.1;
|
double delta = i * 0.1;
|
||||||
int index = MHelper.floor(delta);
|
int index = MHelper.floor(delta);
|
||||||
|
@ -72,7 +73,7 @@ public class TenaneaFlowersBlock extends BaseVineBlock implements IColorProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
COLORS = new Vec3i[] {
|
COLORS = new Vec3i[]{
|
||||||
new Vec3i(250, 111, 222),
|
new Vec3i(250, 111, 222),
|
||||||
new Vec3i(167, 89, 255),
|
new Vec3i(167, 89, 255),
|
||||||
new Vec3i(120, 207, 239),
|
new Vec3i(120, 207, 239),
|
||||||
|
|
|
@ -14,7 +14,7 @@ public class TerrainPlantBlock extends EndPlantBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isTerrain(BlockState state) {
|
protected boolean isTerrain(BlockState state) {
|
||||||
for (Block block: ground) {
|
for (Block block : ground) {
|
||||||
if (state.is(block)) {
|
if (state.is(block)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -14,6 +12,8 @@ import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.blocks.basis.EndPlantBlock;
|
import ru.betterend.blocks.basis.EndPlantBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class TwistedUmbrellaMossBlock extends EndPlantBlock {
|
public class TwistedUmbrellaMossBlock extends EndPlantBlock {
|
||||||
public TwistedUmbrellaMossBlock() {
|
public TwistedUmbrellaMossBlock() {
|
||||||
super(11);
|
super(11);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.world.entity.item.ItemEntity;
|
import net.minecraft.world.entity.item.ItemEntity;
|
||||||
|
@ -10,6 +8,8 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import ru.bclib.blocks.BaseDoublePlantBlock;
|
import ru.bclib.blocks.BaseDoublePlantBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class TwistedUmbrellaMossTallBlock extends BaseDoublePlantBlock {
|
public class TwistedUmbrellaMossTallBlock extends BaseDoublePlantBlock {
|
||||||
public TwistedUmbrellaMossTallBlock() {
|
public TwistedUmbrellaMossTallBlock() {
|
||||||
super(12);
|
super(12);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -14,6 +12,8 @@ import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.blocks.basis.EndPlantBlock;
|
import ru.betterend.blocks.basis.EndPlantBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class UmbrellaMossBlock extends EndPlantBlock {
|
public class UmbrellaMossBlock extends EndPlantBlock {
|
||||||
public UmbrellaMossBlock() {
|
public UmbrellaMossBlock() {
|
||||||
super(11);
|
super(11);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.world.entity.item.ItemEntity;
|
import net.minecraft.world.entity.item.ItemEntity;
|
||||||
|
@ -10,6 +8,8 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import ru.bclib.blocks.BaseDoublePlantBlock;
|
import ru.bclib.blocks.BaseDoublePlantBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class UmbrellaMossTallBlock extends BaseDoublePlantBlock {
|
public class UmbrellaMossTallBlock extends BaseDoublePlantBlock {
|
||||||
public UmbrellaMossTallBlock() {
|
public UmbrellaMossTallBlock() {
|
||||||
super(12);
|
super(12);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
@ -15,6 +13,8 @@ import ru.bclib.blocks.BaseBlock;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class UmbrellaTreeClusterEmptyBlock extends BaseBlock {
|
public class UmbrellaTreeClusterEmptyBlock extends BaseBlock {
|
||||||
public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
|
public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -29,6 +25,9 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class UmbrellaTreeMembraneBlock extends SlimeBlock implements IRenderTyped, BlockModelProvider {
|
public class UmbrellaTreeMembraneBlock extends SlimeBlock implements IRenderTyped, BlockModelProvider {
|
||||||
public static final IntegerProperty COLOR = EndBlockProperties.COLOR;
|
public static final IntegerProperty COLOR = EndBlockProperties.COLOR;
|
||||||
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
|
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package ru.betterend.blocks;
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -36,6 +33,9 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class VentBubbleColumnBlock extends Block implements BucketPickup, LiquidBlockContainer {
|
public class VentBubbleColumnBlock extends Block implements BucketPickup, LiquidBlockContainer {
|
||||||
public VentBubbleColumnBlock() {
|
public VentBubbleColumnBlock() {
|
||||||
super(FabricBlockSettings.of(Material.BUBBLE_COLUMN).noOcclusion().noCollission().noDrops());
|
super(FabricBlockSettings.of(Material.BUBBLE_COLUMN).noOcclusion().noCollission().noDrops());
|
||||||
|
@ -126,7 +126,6 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<SoundEvent> getPickupSound() {
|
public Optional<SoundEvent> getPickupSound() {
|
||||||
return Fluids.WATER.getPickupSound();
|
return Fluids.WATER.getPickupSound();
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package ru.betterend.blocks.basis;
|
package ru.betterend.blocks.basis;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||||
|
@ -17,6 +14,9 @@ import ru.bclib.blocks.BaseAnvilBlock;
|
||||||
import ru.betterend.blocks.complex.MetalMaterial;
|
import ru.betterend.blocks.complex.MetalMaterial;
|
||||||
import ru.betterend.item.EndAnvilItem;
|
import ru.betterend.item.EndAnvilItem;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class EndAnvilBlock extends BaseAnvilBlock {
|
public class EndAnvilBlock extends BaseAnvilBlock {
|
||||||
|
|
||||||
protected final int level;
|
protected final int level;
|
||||||
|
@ -109,7 +109,8 @@ public class EndAnvilBlock extends BaseAnvilBlock {
|
||||||
if (destructionProperty.getPossibleValues().contains(destruction)) {
|
if (destructionProperty.getPossibleValues().contains(destruction)) {
|
||||||
try {
|
try {
|
||||||
return fallingState.setValue(destructionProperty, destruction);
|
return fallingState.setValue(destructionProperty, destruction);
|
||||||
} catch (Exception ex) {
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks.basis;
|
package ru.betterend.blocks.basis;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -28,6 +26,8 @@ import ru.bclib.blocks.BaseBlockNotFull;
|
||||||
import ru.bclib.blocks.BlockProperties;
|
import ru.bclib.blocks.BlockProperties;
|
||||||
import ru.bclib.client.models.ModelsHelper;
|
import ru.bclib.client.models.ModelsHelper;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class EndLanternBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, LiquidBlockContainer {
|
public class EndLanternBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, LiquidBlockContainer {
|
||||||
public static final BooleanProperty IS_FLOOR = BlockProperties.IS_FLOOR;
|
public static final BooleanProperty IS_FLOOR = BlockProperties.IS_FLOOR;
|
||||||
|
|
|
@ -6,7 +6,8 @@ import ru.bclib.blocks.BasePlantWithAgeBlock;
|
||||||
|
|
||||||
public abstract class EndPlantWithAgeBlock extends BasePlantWithAgeBlock {
|
public abstract class EndPlantWithAgeBlock extends BasePlantWithAgeBlock {
|
||||||
|
|
||||||
public EndPlantWithAgeBlock() {}
|
public EndPlantWithAgeBlock() {
|
||||||
|
}
|
||||||
|
|
||||||
public EndPlantWithAgeBlock(Properties settings) {
|
public EndPlantWithAgeBlock(Properties settings) {
|
||||||
super(settings);
|
super(settings);
|
||||||
|
|
|
@ -6,7 +6,8 @@ import ru.bclib.blocks.UnderwaterPlantBlock;
|
||||||
|
|
||||||
public class EndUnderwaterPlantBlock extends UnderwaterPlantBlock {
|
public class EndUnderwaterPlantBlock extends UnderwaterPlantBlock {
|
||||||
|
|
||||||
public EndUnderwaterPlantBlock() {}
|
public EndUnderwaterPlantBlock() {
|
||||||
|
}
|
||||||
|
|
||||||
public EndUnderwaterPlantBlock(int light) {
|
public EndUnderwaterPlantBlock(int light) {
|
||||||
super(light);
|
super(light);
|
||||||
|
|
|
@ -6,7 +6,8 @@ import ru.bclib.blocks.BaseUnderwaterWallPlantBlock;
|
||||||
|
|
||||||
public class EndUnderwaterWallPlantBlock extends BaseUnderwaterWallPlantBlock {
|
public class EndUnderwaterWallPlantBlock extends BaseUnderwaterWallPlantBlock {
|
||||||
|
|
||||||
public EndUnderwaterWallPlantBlock() {}
|
public EndUnderwaterWallPlantBlock() {
|
||||||
|
}
|
||||||
|
|
||||||
public EndUnderwaterWallPlantBlock(int light) {
|
public EndUnderwaterWallPlantBlock(int light) {
|
||||||
super(light);
|
super(light);
|
||||||
|
|
|
@ -5,7 +5,8 @@ import ru.bclib.api.TagAPI;
|
||||||
import ru.bclib.blocks.BaseWallPlantBlock;
|
import ru.bclib.blocks.BaseWallPlantBlock;
|
||||||
|
|
||||||
public class EndWallPlantBlock extends BaseWallPlantBlock {
|
public class EndWallPlantBlock extends BaseWallPlantBlock {
|
||||||
public EndWallPlantBlock() {}
|
public EndWallPlantBlock() {
|
||||||
|
}
|
||||||
|
|
||||||
public EndWallPlantBlock(int light) {
|
public EndWallPlantBlock(int light) {
|
||||||
super(light);
|
super(light);
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
package ru.betterend.blocks.basis;
|
package ru.betterend.blocks.basis;
|
||||||
|
|
||||||
import java.util.EnumMap;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
@ -28,6 +24,9 @@ import ru.bclib.client.render.BCLRenderLayer;
|
||||||
import ru.bclib.interfaces.IRenderTyped;
|
import ru.bclib.interfaces.IRenderTyped;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
|
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class FurBlock extends BaseAttachedBlock implements IRenderTyped {
|
public class FurBlock extends BaseAttachedBlock implements IRenderTyped {
|
||||||
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
||||||
private final ItemLike drop;
|
private final ItemLike drop;
|
||||||
|
|
|
@ -1,17 +1,6 @@
|
||||||
package ru.betterend.blocks.basis;
|
package ru.betterend.blocks.basis;
|
||||||
|
|
||||||
import java.awt.Point;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -34,6 +23,8 @@ import net.minecraft.world.level.LevelAccessor;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.EntityBlock;
|
import net.minecraft.world.level.block.EntityBlock;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.block.state.StateDefinition;
|
import net.minecraft.world.level.block.state.StateDefinition;
|
||||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||||
|
@ -44,6 +35,7 @@ import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||||
import net.minecraft.world.phys.shapes.Shapes;
|
import net.minecraft.world.phys.shapes.Shapes;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ru.bclib.blocks.BaseBlockNotFull;
|
import ru.bclib.blocks.BaseBlockNotFull;
|
||||||
import ru.bclib.blocks.BlockProperties;
|
import ru.bclib.blocks.BlockProperties;
|
||||||
import ru.bclib.client.models.ModelsHelper;
|
import ru.bclib.client.models.ModelsHelper;
|
||||||
|
@ -57,6 +49,12 @@ import ru.betterend.registry.EndBlockEntities;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.rituals.InfusionRitual;
|
import ru.betterend.rituals.InfusionRitual;
|
||||||
|
|
||||||
|
import java.awt.Point;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
@SuppressWarnings({"deprecation"})
|
@SuppressWarnings({"deprecation"})
|
||||||
public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
public final static EnumProperty<PedestalState> STATE = EndBlockProperties.PEDESTAL_STATE;
|
public final static EnumProperty<PedestalState> STATE = EndBlockProperties.PEDESTAL_STATE;
|
||||||
|
@ -71,7 +69,6 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
private static final VoxelShape SHAPE_BOTTOM;
|
private static final VoxelShape SHAPE_BOTTOM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Register new Pedestal block with Better End mod id.
|
* Register new Pedestal block with Better End mod id.
|
||||||
*
|
*
|
||||||
* @param name pedestal name
|
* @param name pedestal name
|
||||||
|
@ -83,7 +80,6 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Register new Pedestal block with specified mod id.
|
* Register new Pedestal block with specified mod id.
|
||||||
*
|
*
|
||||||
* @param id pedestal id
|
* @param id pedestal id
|
||||||
|
@ -126,7 +122,8 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
pedestal.setItem(0, itemStack);
|
pedestal.setItem(0, itemStack);
|
||||||
checkRitual(world, pos);
|
checkRitual(world, pos);
|
||||||
return InteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
ItemStack itemStack = pedestal.getItem(0);
|
ItemStack itemStack = pedestal.getItem(0);
|
||||||
if (player.addItem(itemStack)) {
|
if (player.addItem(itemStack)) {
|
||||||
pedestal.removeItemNoUpdate(0);
|
pedestal.removeItemNoUpdate(0);
|
||||||
|
@ -142,7 +139,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
@Override
|
@Override
|
||||||
public void destroy(LevelAccessor levelAccessor, BlockPos blockPos, BlockState blockState) {
|
public void destroy(LevelAccessor levelAccessor, BlockPos blockPos, BlockState blockState) {
|
||||||
MutableBlockPos posMutable = new MutableBlockPos();
|
MutableBlockPos posMutable = new MutableBlockPos();
|
||||||
for (Point point: InfusionRitual.getMap()) {
|
for (Point point : InfusionRitual.getMap()) {
|
||||||
posMutable.set(blockPos).move(point.x, 0, point.y);
|
posMutable.set(blockPos).move(point.x, 0, point.y);
|
||||||
BlockState state = levelAccessor.getBlockState(posMutable);
|
BlockState state = levelAccessor.getBlockState(posMutable);
|
||||||
if (state.getBlock() instanceof InfusionPedestal) {
|
if (state.getBlock() instanceof InfusionPedestal) {
|
||||||
|
@ -160,7 +157,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
|
|
||||||
public void checkRitual(Level world, BlockPos pos) {
|
public void checkRitual(Level world, BlockPos pos) {
|
||||||
MutableBlockPos posMutable = new MutableBlockPos();
|
MutableBlockPos posMutable = new MutableBlockPos();
|
||||||
for (Point point: InfusionRitual.getMap()) {
|
for (Point point : InfusionRitual.getMap()) {
|
||||||
posMutable.set(pos).move(point.x, 0, point.y);
|
posMutable.set(pos).move(point.x, 0, point.y);
|
||||||
BlockState state = world.getBlockState(posMutable);
|
BlockState state = world.getBlockState(posMutable);
|
||||||
if (state.getBlock() instanceof InfusionPedestal) {
|
if (state.getBlock() instanceof InfusionPedestal) {
|
||||||
|
@ -182,13 +179,17 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
boolean hasPedestalUnder = downState.getBlock() instanceof PedestalBlock;
|
boolean hasPedestalUnder = downState.getBlock() instanceof PedestalBlock;
|
||||||
if (!hasPedestalOver && hasPedestalUnder && upSideSolid) {
|
if (!hasPedestalOver && hasPedestalUnder && upSideSolid) {
|
||||||
return defaultBlockState().setValue(STATE, PedestalState.COLUMN_TOP);
|
return defaultBlockState().setValue(STATE, PedestalState.COLUMN_TOP);
|
||||||
} else if (!hasPedestalOver && !hasPedestalUnder && upSideSolid) {
|
}
|
||||||
|
else if (!hasPedestalOver && !hasPedestalUnder && upSideSolid) {
|
||||||
return defaultBlockState().setValue(STATE, PedestalState.COLUMN);
|
return defaultBlockState().setValue(STATE, PedestalState.COLUMN);
|
||||||
} else if (hasPedestalUnder && hasPedestalOver) {
|
}
|
||||||
|
else if (hasPedestalUnder && hasPedestalOver) {
|
||||||
return defaultBlockState().setValue(STATE, PedestalState.PILLAR);
|
return defaultBlockState().setValue(STATE, PedestalState.PILLAR);
|
||||||
} else if (hasPedestalUnder) {
|
}
|
||||||
|
else if (hasPedestalUnder) {
|
||||||
return defaultBlockState().setValue(STATE, PedestalState.PEDESTAL_TOP);
|
return defaultBlockState().setValue(STATE, PedestalState.PEDESTAL_TOP);
|
||||||
} else if (hasPedestalOver) {
|
}
|
||||||
|
else if (hasPedestalOver) {
|
||||||
return defaultBlockState().setValue(STATE, PedestalState.BOTTOM);
|
return defaultBlockState().setValue(STATE, PedestalState.BOTTOM);
|
||||||
}
|
}
|
||||||
return defaultBlockState();
|
return defaultBlockState();
|
||||||
|
@ -216,21 +217,27 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
if (direction == Direction.UP) {
|
if (direction == Direction.UP) {
|
||||||
upSideSolid = newState.isFaceSturdy(world, posFrom, Direction.DOWN) || newState.is(BlockTags.WALLS);
|
upSideSolid = newState.isFaceSturdy(world, posFrom, Direction.DOWN) || newState.is(BlockTags.WALLS);
|
||||||
hasPedestalOver = newState.getBlock() instanceof PedestalBlock;
|
hasPedestalOver = newState.getBlock() instanceof PedestalBlock;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
hasPedestalUnder = newState.getBlock() instanceof PedestalBlock;
|
hasPedestalUnder = newState.getBlock() instanceof PedestalBlock;
|
||||||
}
|
}
|
||||||
BlockState updatedState;
|
BlockState updatedState;
|
||||||
if (!hasPedestalOver && hasPedestalUnder && upSideSolid) {
|
if (!hasPedestalOver && hasPedestalUnder && upSideSolid) {
|
||||||
updatedState = state.setValue(STATE, PedestalState.COLUMN_TOP);
|
updatedState = state.setValue(STATE, PedestalState.COLUMN_TOP);
|
||||||
} else if (!hasPedestalOver && !hasPedestalUnder && upSideSolid) {
|
}
|
||||||
|
else if (!hasPedestalOver && !hasPedestalUnder && upSideSolid) {
|
||||||
updatedState = state.setValue(STATE, PedestalState.COLUMN);
|
updatedState = state.setValue(STATE, PedestalState.COLUMN);
|
||||||
} else if (hasPedestalUnder && hasPedestalOver) {
|
}
|
||||||
|
else if (hasPedestalUnder && hasPedestalOver) {
|
||||||
updatedState = state.setValue(STATE, PedestalState.PILLAR);
|
updatedState = state.setValue(STATE, PedestalState.PILLAR);
|
||||||
} else if (hasPedestalUnder) {
|
}
|
||||||
|
else if (hasPedestalUnder) {
|
||||||
updatedState = state.setValue(STATE, PedestalState.PEDESTAL_TOP);
|
updatedState = state.setValue(STATE, PedestalState.PEDESTAL_TOP);
|
||||||
} else if (hasPedestalOver) {
|
}
|
||||||
|
else if (hasPedestalOver) {
|
||||||
updatedState = state.setValue(STATE, PedestalState.BOTTOM);
|
updatedState = state.setValue(STATE, PedestalState.BOTTOM);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
updatedState = state.setValue(STATE, PedestalState.DEFAULT);
|
updatedState = state.setValue(STATE, PedestalState.DEFAULT);
|
||||||
}
|
}
|
||||||
if (!isPlaceable(updatedState)) {
|
if (!isPlaceable(updatedState)) {
|
||||||
|
@ -251,7 +258,8 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
drop.add(pedestal.getItem(0));
|
drop.add(pedestal.getItem(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return drop;
|
return drop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -273,18 +281,23 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
BlockState state = world.getBlockState(pos);
|
BlockState state = world.getBlockState(pos);
|
||||||
if (!state.is(this)) {
|
if (!state.is(this)) {
|
||||||
dropStoredStack(blockEntity, stack, pos);
|
dropStoredStack(blockEntity, stack, pos);
|
||||||
} else if (state.getValue(STATE).equals(PedestalState.PILLAR)) {
|
}
|
||||||
|
else if (state.getValue(STATE).equals(PedestalState.PILLAR)) {
|
||||||
moveStoredStack(blockEntity, world, stack, pos.above());
|
moveStoredStack(blockEntity, world, stack, pos.above());
|
||||||
} else if (!isPlaceable(state)) {
|
}
|
||||||
|
else if (!isPlaceable(state)) {
|
||||||
dropStoredStack(blockEntity, stack, pos);
|
dropStoredStack(blockEntity, stack, pos);
|
||||||
} else if (blockEntity instanceof PedestalBlockEntity) {
|
}
|
||||||
|
else if (blockEntity instanceof PedestalBlockEntity) {
|
||||||
PedestalBlockEntity pedestal = (PedestalBlockEntity) blockEntity;
|
PedestalBlockEntity pedestal = (PedestalBlockEntity) blockEntity;
|
||||||
if (pedestal.isEmpty()) {
|
if (pedestal.isEmpty()) {
|
||||||
pedestal.setItem(0, stack);
|
pedestal.setItem(0, stack);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
dropStoredStack(blockEntity, stack, pos);
|
dropStoredStack(blockEntity, stack, pos);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
dropStoredStack(blockEntity, stack, pos);
|
dropStoredStack(blockEntity, stack, pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -304,7 +317,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
if (world.getBlockState(pos.above()).isAir()) {
|
if (world.getBlockState(pos.above()).isAir()) {
|
||||||
return pos.above();
|
return pos.above();
|
||||||
}
|
}
|
||||||
for(int i = 2; i < Direction.values().length; i++) {
|
for (int i = 2; i < Direction.values().length; i++) {
|
||||||
dropPos = pos.relative(Direction.from3DDataValue(i));
|
dropPos = pos.relative(Direction.from3DDataValue(i));
|
||||||
if (world.getBlockState(dropPos).isAir()) {
|
if (world.getBlockState(dropPos).isAir()) {
|
||||||
return dropPos.immutable();
|
return dropPos.immutable();
|
||||||
|
@ -324,7 +337,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
||||||
if (state.is(this)) {
|
if (state.is(this)) {
|
||||||
switch(state.getValue(STATE)) {
|
switch (state.getValue(STATE)) {
|
||||||
case BOTTOM: {
|
case BOTTOM: {
|
||||||
return SHAPE_BOTTOM;
|
return SHAPE_BOTTOM;
|
||||||
}
|
}
|
||||||
|
@ -402,7 +415,8 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
case PILLAR:
|
case PILLAR:
|
||||||
pattern = Patterns.createJson(Patterns.BLOCK_PEDESTAL_PILLAR, textures);
|
pattern = Patterns.createJson(Patterns.BLOCK_PEDESTAL_PILLAR, textures);
|
||||||
break;
|
break;
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return ModelsHelper.fromPattern(pattern);
|
return ModelsHelper.fromPattern(pattern);
|
||||||
}
|
}
|
||||||
|
@ -422,8 +436,9 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
String name = blockId.getPath();
|
String name = blockId.getPath();
|
||||||
return new HashMap<String, String>() {
|
return new HashMap<String, String>() {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
{
|
{
|
||||||
put("%mod%", blockId.getNamespace() );
|
put("%mod%", blockId.getNamespace());
|
||||||
put("%top%", name + "_top");
|
put("%top%", name + "_top");
|
||||||
put("%base%", name + "_base");
|
put("%base%", name + "_base");
|
||||||
put("%pillar%", name + "_pillar");
|
put("%pillar%", name + "_pillar");
|
||||||
|
@ -438,7 +453,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||||
if (level.isClientSide) return null;
|
if (level.isClientSide) return null;
|
||||||
|
|
||||||
BlockEntityTicker<T> ticker = createTickerHelper(blockEntityType, EndBlockEntities.PEDESTAL, PedestalBlockEntity::tick);
|
BlockEntityTicker<T> ticker = createTickerHelper(blockEntityType, EndBlockEntities.PEDESTAL, PedestalBlockEntity::tick);
|
||||||
if (ticker!=null) return ticker;
|
if (ticker != null) return ticker;
|
||||||
|
|
||||||
return createTickerHelper(blockEntityType, EndBlockEntities.INFUSION_PEDESTAL, InfusionPedestalEntity::tick);
|
return createTickerHelper(blockEntityType, EndBlockEntities.INFUSION_PEDESTAL, InfusionPedestalEntity::tick);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package ru.betterend.blocks.basis;
|
package ru.betterend.blocks.basis;
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
|
@ -17,11 +13,14 @@ import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ru.bclib.client.models.ModelsHelper;
|
import ru.bclib.client.models.ModelsHelper;
|
||||||
import ru.bclib.interfaces.IColorProvider;
|
import ru.bclib.interfaces.IColorProvider;
|
||||||
import ru.betterend.client.models.Patterns;
|
import ru.betterend.client.models.Patterns;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class StoneLanternBlock extends EndLanternBlock implements IColorProvider {
|
public class StoneLanternBlock extends EndLanternBlock implements IColorProvider {
|
||||||
private static final VoxelShape SHAPE_CEIL = Block.box(3, 1, 3, 13, 16, 13);
|
private static final VoxelShape SHAPE_CEIL = Block.box(3, 1, 3, 13, 16, 13);
|
||||||
private static final VoxelShape SHAPE_FLOOR = Block.box(3, 0, 3, 13, 15, 13);
|
private static final VoxelShape SHAPE_FLOOR = Block.box(3, 0, 3, 13, 15, 13);
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
package ru.betterend.blocks.complex;
|
package ru.betterend.blocks.complex;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.world.item.DyeColor;
|
import net.minecraft.world.item.DyeColor;
|
||||||
|
@ -18,6 +14,9 @@ import ru.betterend.BetterEnd;
|
||||||
import ru.betterend.config.Configs;
|
import ru.betterend.config.Configs;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
public class ColoredMaterial {
|
public class ColoredMaterial {
|
||||||
private static final Map<Integer, ItemLike> DYES = Maps.newHashMap();
|
private static final Map<Integer, ItemLike> DYES = Maps.newHashMap();
|
||||||
private static final Map<Integer, String> COLORS = Maps.newHashMap();
|
private static final Map<Integer, String> COLORS = Maps.newHashMap();
|
||||||
|
@ -53,7 +52,7 @@ public class ColoredMaterial {
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
for (DyeColor color: DyeColor.values()) {
|
for (DyeColor color : DyeColor.values()) {
|
||||||
int colorRGB = color.getMaterialColor().col;
|
int colorRGB = color.getMaterialColor().col;
|
||||||
COLORS.put(colorRGB, color.getName());
|
COLORS.put(colorRGB, color.getName());
|
||||||
DYES.put(colorRGB, DyeItem.byColor(color));
|
DYES.put(colorRGB, DyeItem.byColor(color));
|
||||||
|
|
|
@ -28,7 +28,6 @@ import ru.bclib.blocks.WoodenPressurePlateBlock;
|
||||||
import ru.bclib.items.ModelProviderItem;
|
import ru.bclib.items.ModelProviderItem;
|
||||||
import ru.bclib.items.tool.BaseAxeItem;
|
import ru.bclib.items.tool.BaseAxeItem;
|
||||||
import ru.bclib.items.tool.BaseHoeItem;
|
import ru.bclib.items.tool.BaseHoeItem;
|
||||||
import ru.bclib.items.tool.BasePickaxeItem;
|
|
||||||
import ru.bclib.items.tool.BaseShovelItem;
|
import ru.bclib.items.tool.BaseShovelItem;
|
||||||
import ru.bclib.items.tool.BaseSwordItem;
|
import ru.bclib.items.tool.BaseSwordItem;
|
||||||
import ru.bclib.recipes.FurnaceRecipe;
|
import ru.bclib.recipes.FurnaceRecipe;
|
||||||
|
@ -49,7 +48,6 @@ import ru.betterend.recipe.builders.AlloyingRecipe;
|
||||||
import ru.betterend.recipe.builders.AnvilRecipe;
|
import ru.betterend.recipe.builders.AnvilRecipe;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
import ru.betterend.registry.EndTags;
|
|
||||||
|
|
||||||
public class MetalMaterial {
|
public class MetalMaterial {
|
||||||
public final Block ore;
|
public final Block ore;
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.blocks.entities;
|
package ru.betterend.blocks.entities;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
@ -21,6 +19,8 @@ import ru.betterend.registry.EndBlockEntities;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndParticles;
|
import ru.betterend.registry.EndParticles;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class BlockEntityHydrothermalVent extends BlockEntity {
|
public class BlockEntityHydrothermalVent extends BlockEntity {
|
||||||
|
|
||||||
private final static Vec3 POSITIVE_Y = new Vec3(0.0f, 1.0f, 0.0f);
|
private final static Vec3 POSITIVE_Y = new Vec3(0.0f, 1.0f, 0.0f);
|
||||||
|
@ -39,7 +39,8 @@ public class BlockEntityHydrothermalVent extends BlockEntity {
|
||||||
double z = worldPosition.getZ() + level.random.nextDouble();
|
double z = worldPosition.getZ() + level.random.nextDouble();
|
||||||
if (state.getValue(HydrothermalVentBlock.WATERLOGGED)) {
|
if (state.getValue(HydrothermalVentBlock.WATERLOGGED)) {
|
||||||
level.addParticle(EndParticles.GEYSER_PARTICLE, x, y, z, 0, 0, 0);
|
level.addParticle(EndParticles.GEYSER_PARTICLE, x, y, z, 0, 0, 0);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
level.addParticle(ParticleTypes.BUBBLE, x, y, z, 0, 0, 0);
|
level.addParticle(ParticleTypes.BUBBLE, x, y, z, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,9 +47,9 @@ import java.util.Map;
|
||||||
|
|
||||||
public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity implements WorldlyContainer, RecipeHolder, StackedContentsCompatible {
|
public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity implements WorldlyContainer, RecipeHolder, StackedContentsCompatible {
|
||||||
|
|
||||||
private static final int[] TOP_SLOTS = new int[] { 0, 1 };
|
private static final int[] TOP_SLOTS = new int[]{0, 1};
|
||||||
private static final int[] BOTTOM_SLOTS = new int[] { 2, 3 };
|
private static final int[] BOTTOM_SLOTS = new int[]{2, 3};
|
||||||
private static final int[] SIDE_SLOTS = new int[] { 1, 2 };
|
private static final int[] SIDE_SLOTS = new int[]{1, 2};
|
||||||
private static final Map<Item, Integer> AVAILABLE_FUELS = Maps.newHashMap();
|
private static final Map<Item, Integer> AVAILABLE_FUELS = Maps.newHashMap();
|
||||||
|
|
||||||
private final Object2IntOpenHashMap<ResourceLocation> recipesUsed;
|
private final Object2IntOpenHashMap<ResourceLocation> recipesUsed;
|
||||||
|
@ -67,7 +67,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
this.recipesUsed = new Object2IntOpenHashMap<>();
|
this.recipesUsed = new Object2IntOpenHashMap<>();
|
||||||
this.propertyDelegate = new ContainerData() {
|
this.propertyDelegate = new ContainerData() {
|
||||||
public int get(int index) {
|
public int get(int index) {
|
||||||
switch(index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
return EndStoneSmelterBlockEntity.this.burnTime;
|
return EndStoneSmelterBlockEntity.this.burnTime;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -82,7 +82,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
}
|
}
|
||||||
|
|
||||||
public void set(int index, int value) {
|
public void set(int index, int value) {
|
||||||
switch(index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
EndStoneSmelterBlockEntity.this.burnTime = value;
|
EndStoneSmelterBlockEntity.this.burnTime = value;
|
||||||
break;
|
break;
|
||||||
|
@ -121,7 +121,8 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
itemStack = iterator.next();
|
itemStack = iterator.next();
|
||||||
} while (itemStack.isEmpty());
|
}
|
||||||
|
while (itemStack.isEmpty());
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -177,7 +178,8 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
if (recipe instanceof AlloyingRecipe) {
|
if (recipe instanceof AlloyingRecipe) {
|
||||||
AlloyingRecipe alloying = (AlloyingRecipe) recipe;
|
AlloyingRecipe alloying = (AlloyingRecipe) recipe;
|
||||||
dropExperience(player.level, player.position(), entry.getIntValue(), alloying.getExperience());
|
dropExperience(player.level, player.position(), entry.getIntValue(), alloying.getExperience());
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
BlastingRecipe blasting = (BlastingRecipe) recipe;
|
BlastingRecipe blasting = (BlastingRecipe) recipe;
|
||||||
dropExperience(player.level, player.position(), entry.getIntValue(), blasting.getExperience());
|
dropExperience(player.level, player.position(), entry.getIntValue(), blasting.getExperience());
|
||||||
}
|
}
|
||||||
|
@ -194,7 +196,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
expTotal++;
|
expTotal++;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(expTotal > 0) {
|
while (expTotal > 0) {
|
||||||
int expVal = ExperienceOrb.getExperienceValue(expTotal);
|
int expVal = ExperienceOrb.getExperienceValue(expTotal);
|
||||||
expTotal -= expVal;
|
expTotal -= expVal;
|
||||||
world.addFreshEntity(new ExperienceOrb(world, vec3d.x, vec3d.y, vec3d.z, expVal));
|
world.addFreshEntity(new ExperienceOrb(world, vec3d.x, vec3d.y, vec3d.z, expVal));
|
||||||
|
@ -239,7 +241,8 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
if (blockEntity.smeltTime > 0) {
|
if (blockEntity.smeltTime > 0) {
|
||||||
blockEntity.smeltTime = Mth.clamp(blockEntity.smeltTime - 2, 0, blockEntity.smeltTimeTotal);
|
blockEntity.smeltTime = Mth.clamp(blockEntity.smeltTime - 2, 0, blockEntity.smeltTimeTotal);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
Recipe<?> recipe = tickLevel.getRecipeManager().getRecipeFor(AlloyingRecipe.TYPE, blockEntity, tickLevel).orElse(null);
|
Recipe<?> recipe = tickLevel.getRecipeManager().getRecipeFor(AlloyingRecipe.TYPE, blockEntity, tickLevel).orElse(null);
|
||||||
if (recipe == null) {
|
if (recipe == null) {
|
||||||
recipe = tickLevel.getRecipeManager().getRecipeFor(RecipeType.BLASTING, blockEntity, tickLevel).orElse(null);
|
recipe = tickLevel.getRecipeManager().getRecipeFor(RecipeType.BLASTING, blockEntity, tickLevel).orElse(null);
|
||||||
|
@ -270,7 +273,8 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
blockEntity.craftRecipe(recipe);
|
blockEntity.craftRecipe(recipe);
|
||||||
blockEntity.setChanged();
|
blockEntity.setChanged();
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
blockEntity.smeltTime = 0;
|
blockEntity.smeltTime = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -288,7 +292,8 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
if (recipe instanceof AlloyingRecipe) {
|
if (recipe instanceof AlloyingRecipe) {
|
||||||
validInput = !inventory.get(0).isEmpty() &&
|
validInput = !inventory.get(0).isEmpty() &&
|
||||||
!inventory.get(1).isEmpty();
|
!inventory.get(1).isEmpty();
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
validInput = !inventory.get(0).isEmpty() ||
|
validInput = !inventory.get(0).isEmpty() ||
|
||||||
!inventory.get(1).isEmpty();
|
!inventory.get(1).isEmpty();
|
||||||
}
|
}
|
||||||
|
@ -321,7 +326,8 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
ItemStack output = inventory.get(3);
|
ItemStack output = inventory.get(3);
|
||||||
if (output.isEmpty()) {
|
if (output.isEmpty()) {
|
||||||
inventory.set(3, result.copy());
|
inventory.set(3, result.copy());
|
||||||
} else if (output.getItem() == result.getItem()) {
|
}
|
||||||
|
else if (output.getItem() == result.getItem()) {
|
||||||
output.grow(result.getCount());
|
output.grow(result.getCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,10 +339,12 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
if (recipe instanceof AlloyingRecipe) {
|
if (recipe instanceof AlloyingRecipe) {
|
||||||
inventory.get(0).shrink(1);
|
inventory.get(0).shrink(1);
|
||||||
inventory.get(1).shrink(1);
|
inventory.get(1).shrink(1);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (!inventory.get(0).isEmpty()) {
|
if (!inventory.get(0).isEmpty()) {
|
||||||
inventory.get(0).shrink(1);
|
inventory.get(0).shrink(1);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
inventory.get(1).shrink(1);
|
inventory.get(1).shrink(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -425,7 +433,8 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
public boolean canPlaceItem(int slot, ItemStack stack) {
|
public boolean canPlaceItem(int slot, ItemStack stack) {
|
||||||
if (slot == 3) {
|
if (slot == 3) {
|
||||||
return false;
|
return false;
|
||||||
} else if (slot != 2) {
|
}
|
||||||
|
else if (slot != 2) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
ItemStack itemStack = this.inventory.get(2);
|
ItemStack itemStack = this.inventory.get(2);
|
||||||
|
|
|
@ -16,11 +16,12 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setLevel(Level world){
|
public void setLevel(Level world) {
|
||||||
super.setLevel(world);
|
super.setLevel(world);
|
||||||
if (hasRitual()) {
|
if (hasRitual()) {
|
||||||
linkedRitual.setLocation(world, this.getBlockPos());
|
linkedRitual.setLocation(world, this.getBlockPos());
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
linkRitual(new InfusionRitual(this, world, this.getBlockPos()));
|
linkRitual(new InfusionRitual(this, world, this.getBlockPos()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +29,8 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
|
||||||
public void setLevelAndPosition(Level world, BlockPos pos) {
|
public void setLevelAndPosition(Level world, BlockPos pos) {
|
||||||
if (hasRitual()) {
|
if (hasRitual()) {
|
||||||
linkedRitual.setLocation(world, pos);
|
linkedRitual.setLocation(world, pos);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
linkRitual(new InfusionRitual(this, world, pos));
|
linkRitual(new InfusionRitual(this, world, pos));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,8 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
|
||||||
BlockState trueState = state.setValue(PedestalBlock.HAS_ITEM, !isEmpty());
|
BlockState trueState = state.setValue(PedestalBlock.HAS_ITEM, !isEmpty());
|
||||||
if (activeItem.getItem() == EndItems.ETERNAL_CRYSTAL) {
|
if (activeItem.getItem() == EndItems.ETERNAL_CRYSTAL) {
|
||||||
trueState = trueState.setValue(PedestalBlock.HAS_LIGHT, true);
|
trueState = trueState.setValue(PedestalBlock.HAS_LIGHT, true);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
trueState = trueState.setValue(PedestalBlock.HAS_LIGHT, false);
|
trueState = trueState.setValue(PedestalBlock.HAS_LIGHT, false);
|
||||||
}
|
}
|
||||||
level.setBlockAndUpdate(worldPosition, trueState);
|
level.setBlockAndUpdate(worldPosition, trueState);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.betterend.client;
|
package ru.betterend.client;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.fabricmc.api.ClientModInitializer;
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
|
@ -30,6 +28,8 @@ import ru.betterend.registry.EndModelProviders;
|
||||||
import ru.betterend.registry.EndParticles;
|
import ru.betterend.registry.EndParticles;
|
||||||
import ru.betterend.registry.EndScreens;
|
import ru.betterend.registry.EndScreens;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class BetterEndClient implements ClientModInitializer {
|
public class BetterEndClient implements ClientModInitializer {
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient() {
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
package ru.betterend.client.gui;
|
package ru.betterend.client.gui;
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.client.gui.GuiComponent;
|
import net.minecraft.client.gui.GuiComponent;
|
||||||
|
@ -20,6 +15,10 @@ import net.minecraft.world.item.crafting.Ingredient;
|
||||||
import net.minecraft.world.item.crafting.Recipe;
|
import net.minecraft.world.item.crafting.Recipe;
|
||||||
import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
|
import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public class EndStoneSmelterRecipeBookScreen extends BlastingRecipeBookComponent {
|
public class EndStoneSmelterRecipeBookScreen extends BlastingRecipeBookComponent {
|
||||||
private Iterator<Item> fuelIterator;
|
private Iterator<Item> fuelIterator;
|
||||||
|
@ -49,7 +48,7 @@ public class EndStoneSmelterRecipeBookScreen extends BlastingRecipeBookComponent
|
||||||
this.ghostRecipe.addIngredient(Ingredient.of(result), (slots.get(3)).x, (slots.get(3)).y);
|
this.ghostRecipe.addIngredient(Ingredient.of(result), (slots.get(3)).x, (slots.get(3)).y);
|
||||||
NonNullList<Ingredient> inputs = recipe.getIngredients();
|
NonNullList<Ingredient> inputs = recipe.getIngredients();
|
||||||
Iterator<Ingredient> iterator = inputs.iterator();
|
Iterator<Ingredient> iterator = inputs.iterator();
|
||||||
for(int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
if (!iterator.hasNext()) {
|
if (!iterator.hasNext()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +79,7 @@ public class EndStoneSmelterRecipeBookScreen extends BlastingRecipeBookComponent
|
||||||
int slotY = this.fuelSlot.y + y;
|
int slotY = this.fuelSlot.y + y;
|
||||||
GuiComponent.fill(matrices, slotX, slotY, slotX + 16, slotY + 16, 822018048);
|
GuiComponent.fill(matrices, slotX, slotY, slotX + 16, slotY + 16, 822018048);
|
||||||
//TODO: test k=0
|
//TODO: test k=0
|
||||||
this.minecraft.getItemRenderer().renderAndDecorateItem(minecraft.player, this.getFuel().getDefaultInstance(), slotX, slotY,0);
|
this.minecraft.getItemRenderer().renderAndDecorateItem(minecraft.player, this.getFuel().getDefaultInstance(), slotX, slotY, 0);
|
||||||
RenderSystem.depthFunc(516);
|
RenderSystem.depthFunc(516);
|
||||||
GuiComponent.fill(matrices, slotX, slotY, slotX + 16, slotY + 16, 822083583);
|
GuiComponent.fill(matrices, slotX, slotY, slotX + 16, slotY + 16, 822083583);
|
||||||
RenderSystem.depthFunc(515);
|
RenderSystem.depthFunc(515);
|
||||||
|
|
|
@ -2,7 +2,6 @@ package ru.betterend.client.gui;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.client.gui.components.ImageButton;
|
import net.minecraft.client.gui.components.ImageButton;
|
||||||
|
@ -39,7 +38,7 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen<EndStoneSmelt
|
||||||
addRenderableWidget(new ImageButton(leftPos + 20, height / 2 - 49, 20, 18, 0, 0, 19, RECIPE_BUTTON_TEXTURE, (buttonWidget) -> {
|
addRenderableWidget(new ImageButton(leftPos + 20, height / 2 - 49, 20, 18, 0, 0, 19, RECIPE_BUTTON_TEXTURE, (buttonWidget) -> {
|
||||||
recipeBook.initVisuals();
|
recipeBook.initVisuals();
|
||||||
recipeBook.toggleVisibility();
|
recipeBook.toggleVisibility();
|
||||||
leftPos = recipeBook.updateScreenPosition( width, imageWidth);
|
leftPos = recipeBook.updateScreenPosition(width, imageWidth);
|
||||||
((ImageButton) buttonWidget).setPosition(leftPos + 20, height / 2 - 49);
|
((ImageButton) buttonWidget).setPosition(leftPos + 20, height / 2 - 49);
|
||||||
}));
|
}));
|
||||||
titleLabelX = (imageWidth - font.width(title)) / 2;
|
titleLabelX = (imageWidth - font.width(title)) / 2;
|
||||||
|
@ -57,7 +56,8 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen<EndStoneSmelt
|
||||||
if (recipeBook.isVisible() && narrow) {
|
if (recipeBook.isVisible() && narrow) {
|
||||||
renderBg(matrices, delta, mouseX, mouseY);
|
renderBg(matrices, delta, mouseX, mouseY);
|
||||||
recipeBook.render(matrices, mouseX, mouseY, delta);
|
recipeBook.render(matrices, mouseX, mouseY, delta);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
recipeBook.render(matrices, mouseX, mouseY, delta);
|
recipeBook.render(matrices, mouseX, mouseY, delta);
|
||||||
super.render(matrices, mouseX, mouseY, delta);
|
super.render(matrices, mouseX, mouseY, delta);
|
||||||
recipeBook.renderGhostRecipe(matrices, leftPos, topPos, true, delta);
|
recipeBook.renderGhostRecipe(matrices, leftPos, topPos, true, delta);
|
||||||
|
@ -70,7 +70,8 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen<EndStoneSmelt
|
||||||
public boolean mouseClicked(double mouseX, double mouseY, int button) {
|
public boolean mouseClicked(double mouseX, double mouseY, int button) {
|
||||||
if (this.recipeBook.mouseClicked(mouseX, mouseY, button)) {
|
if (this.recipeBook.mouseClicked(mouseX, mouseY, button)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return narrow && recipeBook.isVisible() || super.mouseClicked(mouseX, mouseY, button);
|
return narrow && recipeBook.isVisible() || super.mouseClicked(mouseX, mouseY, button);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,12 +50,12 @@ public class EndStoneSmelterScreenHandler extends RecipeBookMenu<Container> {
|
||||||
addSlot(new SmelterFuelSlot(this, inventory, 2, 56, 53));
|
addSlot(new SmelterFuelSlot(this, inventory, 2, 56, 53));
|
||||||
addSlot(new SmelterOutputSlot(playerInventory.player, inventory, 3, 129, 35));
|
addSlot(new SmelterOutputSlot(playerInventory.player, inventory, 3, 129, 35));
|
||||||
|
|
||||||
for(int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
for(int j = 0; j < 9; ++j) {
|
for (int j = 0; j < 9; ++j) {
|
||||||
addSlot(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
addSlot(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(int i = 0; i < 9; ++i) {
|
for (int i = 0; i < 9; ++i) {
|
||||||
addSlot(new Slot(playerInventory, i, 8 + i * 18, 142));
|
addSlot(new Slot(playerInventory, i, 8 + i * 18, 142));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,29 +137,35 @@ public class EndStoneSmelterScreenHandler extends RecipeBookMenu<Container> {
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
}
|
}
|
||||||
slot.onQuickCraft(slotStack, itemStack);
|
slot.onQuickCraft(slotStack, itemStack);
|
||||||
} else if (index != 2 && index != 1 && index != 0) {
|
}
|
||||||
|
else if (index != 2 && index != 1 && index != 0) {
|
||||||
if (isSmeltable(slotStack)) {
|
if (isSmeltable(slotStack)) {
|
||||||
if (!moveItemStackTo(slotStack, 0, 2, false)) {
|
if (!moveItemStackTo(slotStack, 0, 2, false)) {
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
}
|
}
|
||||||
} else if (isFuel(slotStack)) {
|
}
|
||||||
|
else if (isFuel(slotStack)) {
|
||||||
if (!moveItemStackTo(slotStack, 2, 3, false)) {
|
if (!moveItemStackTo(slotStack, 2, 3, false)) {
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
}
|
}
|
||||||
} else if (index < 31) {
|
}
|
||||||
|
else if (index < 31) {
|
||||||
if (!moveItemStackTo(slotStack, 31, 40, false)) {
|
if (!moveItemStackTo(slotStack, 31, 40, false)) {
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
}
|
}
|
||||||
} else if (index < 40 && !moveItemStackTo(slotStack, 4, 31, false)) {
|
}
|
||||||
|
else if (index < 40 && !moveItemStackTo(slotStack, 4, 31, false)) {
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
}
|
}
|
||||||
} else if (!moveItemStackTo(slotStack, 4, 40, false)) {
|
}
|
||||||
|
else if (!moveItemStackTo(slotStack, 4, 40, false)) {
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (slotStack.isEmpty()) {
|
if (slotStack.isEmpty()) {
|
||||||
slot.set(ItemStack.EMPTY);
|
slot.set(ItemStack.EMPTY);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
slot.setChanged();
|
slot.setChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
package ru.betterend.client.models;
|
package ru.betterend.client.models;
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.server.packs.resources.ResourceManager;
|
||||||
|
import ru.betterend.BetterEnd;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
@ -10,13 +16,6 @@ import java.util.Map.Entry;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
|
||||||
import net.minecraft.server.packs.resources.ResourceManager;
|
|
||||||
import ru.betterend.BetterEnd;
|
|
||||||
|
|
||||||
public class Patterns {
|
public class Patterns {
|
||||||
//Block Models
|
//Block Models
|
||||||
public final static ResourceLocation BLOCK_EMPTY = BetterEnd.makeID("patterns/block/empty.json");
|
public final static ResourceLocation BLOCK_EMPTY = BetterEnd.makeID("patterns/block/empty.json");
|
||||||
|
@ -93,6 +92,7 @@ public class Patterns {
|
||||||
public static Optional<String> createBlockSimple(String name) {
|
public static Optional<String> createBlockSimple(String name) {
|
||||||
return Patterns.createJson(Patterns.BLOCK_BASE, name, name);
|
return Patterns.createJson(Patterns.BLOCK_BASE, name, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<String> createBlockPillar(String name) {
|
public static Optional<String> createBlockPillar(String name) {
|
||||||
return Patterns.createJson(Patterns.BLOCK_PILLAR, name, name);
|
return Patterns.createJson(Patterns.BLOCK_PILLAR, name, name);
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,8 @@ public class Patterns {
|
||||||
return buffer.lines().collect(Collectors.joining())
|
return buffer.lines().collect(Collectors.joining())
|
||||||
.replace("%parent%", parent)
|
.replace("%parent%", parent)
|
||||||
.replace("%block%", block);
|
.replace("%block%", block);
|
||||||
} catch (Exception ex) {
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,7 +112,8 @@ public class Patterns {
|
||||||
ResourceManager resourceManager = Minecraft.getInstance().getResourceManager();
|
ResourceManager resourceManager = Minecraft.getInstance().getResourceManager();
|
||||||
try (InputStream input = resourceManager.getResource(patternId).getInputStream()) {
|
try (InputStream input = resourceManager.getResource(patternId).getInputStream()) {
|
||||||
return Optional.ofNullable(createJson(new InputStreamReader(input, StandardCharsets.UTF_8), parent, block));
|
return Optional.ofNullable(createJson(new InputStreamReader(input, StandardCharsets.UTF_8), parent, block));
|
||||||
} catch (Exception ex) {
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,7 +133,8 @@ public class Patterns {
|
||||||
json = json.replace(texture.getKey(), texture.getValue());
|
json = json.replace(texture.getKey(), texture.getValue());
|
||||||
}
|
}
|
||||||
return Optional.of(json);
|
return Optional.of(json);
|
||||||
} catch (Exception ex) {
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package ru.betterend.client.render;
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
|
|
||||||
import net.minecraft.client.model.EntityModel;
|
import net.minecraft.client.model.EntityModel;
|
||||||
import net.minecraft.client.model.geom.EntityModelSet;
|
import net.minecraft.client.model.geom.EntityModelSet;
|
||||||
import net.minecraft.client.player.AbstractClientPlayer;
|
import net.minecraft.client.player.AbstractClientPlayer;
|
||||||
|
@ -37,7 +36,8 @@ public class ArmoredElytraLayer<T extends LivingEntity, M extends EntityModel<T>
|
||||||
AbstractClientPlayer abstractClientPlayer = (AbstractClientPlayer) livingEntity;
|
AbstractClientPlayer abstractClientPlayer = (AbstractClientPlayer) livingEntity;
|
||||||
if (abstractClientPlayer.isElytraLoaded() && abstractClientPlayer.getElytraTextureLocation() != null) {
|
if (abstractClientPlayer.isElytraLoaded() && abstractClientPlayer.getElytraTextureLocation() != null) {
|
||||||
wingsTexture = abstractClientPlayer.getElytraTextureLocation();
|
wingsTexture = abstractClientPlayer.getElytraTextureLocation();
|
||||||
} else if (abstractClientPlayer.isCapeLoaded() && abstractClientPlayer.getCloakTextureLocation() != null && abstractClientPlayer.isModelPartShown(PlayerModelPart.CAPE)) {
|
}
|
||||||
|
else if (abstractClientPlayer.isCapeLoaded() && abstractClientPlayer.getCloakTextureLocation() != null && abstractClientPlayer.isModelPartShown(PlayerModelPart.CAPE)) {
|
||||||
wingsTexture = abstractClientPlayer.getCloakTextureLocation();
|
wingsTexture = abstractClientPlayer.getCloakTextureLocation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import com.mojang.math.Matrix3f;
|
import com.mojang.math.Matrix3f;
|
||||||
import com.mojang.math.Matrix4f;
|
import com.mojang.math.Matrix4f;
|
||||||
import com.mojang.math.Vector3f;
|
import com.mojang.math.Vector3f;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import com.mojang.math.Quaternion;
|
import com.mojang.math.Quaternion;
|
||||||
import com.mojang.math.Vector3f;
|
import com.mojang.math.Vector3f;
|
||||||
|
|
||||||
import net.minecraft.client.model.geom.ModelPart;
|
import net.minecraft.client.model.geom.ModelPart;
|
||||||
import net.minecraft.client.model.geom.PartPose;
|
import net.minecraft.client.model.geom.PartPose;
|
||||||
import net.minecraft.client.model.geom.builders.CubeListBuilder;
|
import net.minecraft.client.model.geom.builders.CubeListBuilder;
|
||||||
|
|
|
@ -3,7 +3,6 @@ package ru.betterend.client.render;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import com.mojang.math.Vector3f;
|
import com.mojang.math.Vector3f;
|
||||||
|
|
||||||
import net.minecraft.client.model.geom.ModelPart;
|
import net.minecraft.client.model.geom.ModelPart;
|
||||||
import net.minecraft.client.model.geom.PartPose;
|
import net.minecraft.client.model.geom.PartPose;
|
||||||
import net.minecraft.client.model.geom.builders.CubeListBuilder;
|
import net.minecraft.client.model.geom.builders.CubeListBuilder;
|
||||||
|
|
|
@ -2,16 +2,13 @@ package ru.betterend.client.render;
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.math.Vector3f;
|
import com.mojang.math.Vector3f;
|
||||||
|
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.client.renderer.block.model.ItemTransforms;
|
import net.minecraft.client.renderer.block.model.ItemTransforms;
|
||||||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher;
|
|
||||||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
|
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
|
||||||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
|
||||||
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
|
||||||
import net.minecraft.client.resources.model.BakedModel;
|
import net.minecraft.client.resources.model.BakedModel;
|
||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
|
@ -54,7 +51,8 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> implements Bloc
|
||||||
matrices.translate(0.5, pedestal.getHeight(state), 0.5);
|
matrices.translate(0.5, pedestal.getHeight(state), 0.5);
|
||||||
if (activeItem.getItem() instanceof BlockItem) {
|
if (activeItem.getItem() instanceof BlockItem) {
|
||||||
matrices.scale(1.5F, 1.5F, 1.5F);
|
matrices.scale(1.5F, 1.5F, 1.5F);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
matrices.scale(1.25F, 1.25F, 1.25F);
|
matrices.scale(1.25F, 1.25F, 1.25F);
|
||||||
}
|
}
|
||||||
int age = blockEntity.getAge();
|
int age = blockEntity.getAge();
|
||||||
|
@ -68,9 +66,11 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> implements Bloc
|
||||||
}
|
}
|
||||||
if (activeItem.getItem() == Items.END_CRYSTAL) {
|
if (activeItem.getItem() == Items.END_CRYSTAL) {
|
||||||
EndCrystalRenderer.render(age, blockEntity.getMaxAge(), tickDelta, matrices, vertexConsumers, light);
|
EndCrystalRenderer.render(age, blockEntity.getMaxAge(), tickDelta, matrices, vertexConsumers, light);
|
||||||
} else if (activeItem.getItem() == EndItems.ETERNAL_CRYSTAL) {
|
}
|
||||||
|
else if (activeItem.getItem() == EndItems.ETERNAL_CRYSTAL) {
|
||||||
EternalCrystalRenderer.render(age, tickDelta, matrices, vertexConsumers, light);
|
EternalCrystalRenderer.render(age, tickDelta, matrices, vertexConsumers, light);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
float rotation = (age + tickDelta) / 25.0F + 6.0F;
|
float rotation = (age + tickDelta) / 25.0F + 6.0F;
|
||||||
matrices.mulPose(Vector3f.YP.rotation(rotation));
|
matrices.mulPose(Vector3f.YP.rotation(rotation));
|
||||||
minecraft.getItemRenderer().render(activeItem, ItemTransforms.TransformType.GROUND, false, matrices, vertexConsumers, light, overlay, model);
|
minecraft.getItemRenderer().render(activeItem, ItemTransforms.TransformType.GROUND, false, matrices, vertexConsumers, light, overlay, model);
|
||||||
|
|
|
@ -12,5 +12,6 @@ public class EndEnchantments {
|
||||||
return Registry.register(Registry.ENCHANTMENT, BetterEnd.makeID(name), enchantment);
|
return Registry.register(Registry.ENCHANTMENT, BetterEnd.makeID(name), enchantment);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void register() {}
|
public static void register() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import net.minecraft.world.item.enchantment.EnchantmentCategory;
|
||||||
public class EndVeilEnchantment extends Enchantment {
|
public class EndVeilEnchantment extends Enchantment {
|
||||||
|
|
||||||
public EndVeilEnchantment() {
|
public EndVeilEnchantment() {
|
||||||
super(Enchantment.Rarity.VERY_RARE, EnchantmentCategory.ARMOR_HEAD, new EquipmentSlot[] { EquipmentSlot.HEAD });
|
super(Enchantment.Rarity.VERY_RARE, EnchantmentCategory.ARMOR_HEAD, new EquipmentSlot[]{EquipmentSlot.HEAD});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package ru.betterend.entity;
|
package ru.betterend.entity;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.protocol.game.ClientboundGameEventPacket;
|
import net.minecraft.network.protocol.game.ClientboundGameEventPacket;
|
||||||
|
@ -35,6 +32,9 @@ import ru.bclib.api.BiomeAPI;
|
||||||
import ru.betterend.registry.EndBiomes;
|
import ru.betterend.registry.EndBiomes;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class CubozoaEntity extends AbstractSchoolingFish {
|
public class CubozoaEntity extends AbstractSchoolingFish {
|
||||||
public static final int VARIANTS = 2;
|
public static final int VARIANTS = 2;
|
||||||
private static final EntityDataAccessor<Byte> VARIANT = SynchedEntityData.defineId(CubozoaEntity.class, EntityDataSerializers.BYTE);
|
private static final EntityDataAccessor<Byte> VARIANT = SynchedEntityData.defineId(CubozoaEntity.class, EntityDataSerializers.BYTE);
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
package ru.betterend.entity;
|
package ru.betterend.entity;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
import net.minecraft.world.damagesource.DamageSource;
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
import net.minecraft.world.entity.*;
|
import net.minecraft.world.entity.AgeableMob;
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
|
import net.minecraft.world.entity.MobSpawnType;
|
||||||
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
import net.minecraft.world.entity.ai.control.FlyingMoveControl;
|
import net.minecraft.world.entity.ai.control.FlyingMoveControl;
|
||||||
|
@ -36,6 +38,9 @@ import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.registry.EndEntities;
|
import ru.betterend.registry.EndEntities;
|
||||||
import ru.betterend.registry.EndSounds;
|
import ru.betterend.registry.EndSounds;
|
||||||
|
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class DragonflyEntity extends Animal implements FlyingAnimal {
|
public class DragonflyEntity extends Animal implements FlyingAnimal {
|
||||||
public DragonflyEntity(EntityType<DragonflyEntity> entityType, Level world) {
|
public DragonflyEntity(EntityType<DragonflyEntity> entityType, Level world) {
|
||||||
super(entityType, world);
|
super(entityType, world);
|
||||||
|
@ -158,7 +163,8 @@ public class DragonflyEntity extends Animal implements FlyingAnimal {
|
||||||
DragonflyEntity.this.navigation.moveTo(path, 1.0D);
|
DragonflyEntity.this.navigation.moveTo(path, 1.0D);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e) {}
|
catch (Exception e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
super.start();
|
super.start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package ru.betterend.entity;
|
package ru.betterend.entity;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.particles.ParticleTypes;
|
import net.minecraft.core.particles.ParticleTypes;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
@ -30,6 +27,9 @@ import ru.bclib.api.BiomeAPI;
|
||||||
import ru.betterend.registry.EndBiomes;
|
import ru.betterend.registry.EndBiomes;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class EndFishEntity extends AbstractSchoolingFish {
|
public class EndFishEntity extends AbstractSchoolingFish {
|
||||||
public static final int VARIANTS_NORMAL = 5;
|
public static final int VARIANTS_NORMAL = 5;
|
||||||
public static final int VARIANTS_SULPHUR = 3;
|
public static final int VARIANTS_SULPHUR = 3;
|
||||||
|
@ -148,7 +148,9 @@ public class EndFishEntity extends AbstractSchoolingFish {
|
||||||
|
|
||||||
public static boolean canSpawn(EntityType<EndFishEntity> type, ServerLevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) {
|
public static boolean canSpawn(EntityType<EndFishEntity> type, ServerLevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) {
|
||||||
AABB box = new AABB(pos).inflate(16);
|
AABB box = new AABB(pos).inflate(16);
|
||||||
List<EndFishEntity> list = world.getEntitiesOfClass(EndFishEntity.class, box, (entity) -> { return true; });
|
List<EndFishEntity> list = world.getEntitiesOfClass(EndFishEntity.class, box, (entity) -> {
|
||||||
|
return true;
|
||||||
|
});
|
||||||
return list.size() < 9;
|
return list.size() < 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package ru.betterend.entity;
|
package ru.betterend.entity;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||||
import net.minecraft.core.particles.ParticleOptions;
|
import net.minecraft.core.particles.ParticleOptions;
|
||||||
|
@ -45,6 +41,10 @@ import ru.bclib.world.biomes.BCLBiome;
|
||||||
import ru.betterend.interfaces.ISlime;
|
import ru.betterend.interfaces.ISlime;
|
||||||
import ru.betterend.registry.EndBiomes;
|
import ru.betterend.registry.EndBiomes;
|
||||||
|
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class EndSlimeEntity extends Slime {
|
public class EndSlimeEntity extends Slime {
|
||||||
private static final EntityDataAccessor<Byte> VARIANT = SynchedEntityData.defineId(EndSlimeEntity.class, EntityDataSerializers.BYTE);
|
private static final EntityDataAccessor<Byte> VARIANT = SynchedEntityData.defineId(EndSlimeEntity.class, EntityDataSerializers.BYTE);
|
||||||
private static final MutableBlockPos POS = new MutableBlockPos();
|
private static final MutableBlockPos POS = new MutableBlockPos();
|
||||||
|
@ -145,7 +145,7 @@ public class EndSlimeEntity extends Slime {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
((ISlime)this).entityRemove(reason);
|
((ISlime) this).entityRemove(reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -211,7 +211,9 @@ public class EndSlimeEntity extends Slime {
|
||||||
|
|
||||||
private static boolean notManyEntities(ServerLevelAccessor world, BlockPos pos, int radius, int maxCount) {
|
private static boolean notManyEntities(ServerLevelAccessor world, BlockPos pos, int radius, int maxCount) {
|
||||||
AABB box = new AABB(pos).inflate(radius);
|
AABB box = new AABB(pos).inflate(radius);
|
||||||
List<EndSlimeEntity> list = world.getEntitiesOfClass(EndSlimeEntity.class, box, (entity) -> { return true; });
|
List<EndSlimeEntity> list = world.getEntitiesOfClass(EndSlimeEntity.class, box, (entity) -> {
|
||||||
|
return true;
|
||||||
|
});
|
||||||
return list.size() <= maxCount;
|
return list.size() <= maxCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package ru.betterend.entity;
|
package ru.betterend.entity;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.particles.ParticleTypes;
|
import net.minecraft.core.particles.ParticleTypes;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
@ -29,6 +26,9 @@ import net.minecraft.world.phys.AABB;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.registry.EndSounds;
|
import ru.betterend.registry.EndSounds;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class ShadowWalkerEntity extends Monster {
|
public class ShadowWalkerEntity extends Monster {
|
||||||
public ShadowWalkerEntity(EntityType<ShadowWalkerEntity> entityType, Level world) {
|
public ShadowWalkerEntity(EntityType<ShadowWalkerEntity> entityType, Level world) {
|
||||||
super(entityType, world);
|
super(entityType, world);
|
||||||
|
@ -88,7 +88,8 @@ public class ShadowWalkerEntity extends Monster {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void playStepSound(BlockPos pos, BlockState state) {}
|
protected void playStepSound(BlockPos pos, BlockState state) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected float getSoundVolume() {
|
protected float getSoundVolume() {
|
||||||
|
@ -115,7 +116,9 @@ public class ShadowWalkerEntity extends Monster {
|
||||||
public static boolean canSpawn(EntityType<ShadowWalkerEntity> type, ServerLevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) {
|
public static boolean canSpawn(EntityType<ShadowWalkerEntity> type, ServerLevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) {
|
||||||
if (Monster.checkMonsterSpawnRules(type, world, spawnReason, pos, random)) {
|
if (Monster.checkMonsterSpawnRules(type, world, spawnReason, pos, random)) {
|
||||||
AABB box = new AABB(pos).inflate(16);
|
AABB box = new AABB(pos).inflate(16);
|
||||||
List<ShadowWalkerEntity> entities = world.getEntitiesOfClass(ShadowWalkerEntity.class, box, (entity) -> { return true; });
|
List<ShadowWalkerEntity> entities = world.getEntitiesOfClass(ShadowWalkerEntity.class, box, (entity) -> {
|
||||||
|
return true;
|
||||||
|
});
|
||||||
return entities.size() < 6;
|
return entities.size() < 6;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,14 +1,5 @@
|
||||||
package ru.betterend.entity;
|
package ru.betterend.entity;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.world.entity.*;
|
|
||||||
import net.minecraft.world.entity.ai.util.AirAndWaterRandomPos;
|
|
||||||
import net.minecraft.world.entity.ai.util.HoverRandomPos;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
@ -19,6 +10,12 @@ import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.sounds.SoundEvents;
|
import net.minecraft.sounds.SoundEvents;
|
||||||
import net.minecraft.sounds.SoundSource;
|
import net.minecraft.sounds.SoundSource;
|
||||||
import net.minecraft.world.damagesource.DamageSource;
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
|
import net.minecraft.world.entity.AgeableMob;
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
|
import net.minecraft.world.entity.MobSpawnType;
|
||||||
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
import net.minecraft.world.entity.ai.control.FlyingMoveControl;
|
import net.minecraft.world.entity.ai.control.FlyingMoveControl;
|
||||||
|
@ -29,7 +26,8 @@ import net.minecraft.world.entity.ai.goal.FollowParentGoal;
|
||||||
import net.minecraft.world.entity.ai.goal.Goal;
|
import net.minecraft.world.entity.ai.goal.Goal;
|
||||||
import net.minecraft.world.entity.ai.navigation.FlyingPathNavigation;
|
import net.minecraft.world.entity.ai.navigation.FlyingPathNavigation;
|
||||||
import net.minecraft.world.entity.ai.navigation.PathNavigation;
|
import net.minecraft.world.entity.ai.navigation.PathNavigation;
|
||||||
import net.minecraft.world.entity.ai.util.RandomPos;
|
import net.minecraft.world.entity.ai.util.AirAndWaterRandomPos;
|
||||||
|
import net.minecraft.world.entity.ai.util.HoverRandomPos;
|
||||||
import net.minecraft.world.entity.animal.Animal;
|
import net.minecraft.world.entity.animal.Animal;
|
||||||
import net.minecraft.world.entity.animal.FlyingAnimal;
|
import net.minecraft.world.entity.animal.FlyingAnimal;
|
||||||
import net.minecraft.world.entity.item.ItemEntity;
|
import net.minecraft.world.entity.item.ItemEntity;
|
||||||
|
@ -44,6 +42,7 @@ import net.minecraft.world.level.levelgen.Heightmap.Types;
|
||||||
import net.minecraft.world.level.pathfinder.BlockPathTypes;
|
import net.minecraft.world.level.pathfinder.BlockPathTypes;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import ru.bclib.util.BlocksHelper;
|
import ru.bclib.util.BlocksHelper;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.BetterEnd;
|
import ru.betterend.BetterEnd;
|
||||||
|
@ -52,6 +51,10 @@ import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndEntities;
|
import ru.betterend.registry.EndEntities;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
|
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
public class SilkMothEntity extends Animal implements FlyingAnimal {
|
public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
private BlockPos hivePos;
|
private BlockPos hivePos;
|
||||||
private BlockPos entrance;
|
private BlockPos entrance;
|
||||||
|
@ -230,7 +233,8 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
try {
|
try {
|
||||||
SilkMothEntity.this.navigation.moveTo(SilkMothEntity.this.navigation.createPath(new BlockPos(vec3d), 1), 1.0D);
|
SilkMothEntity.this.navigation.moveTo(SilkMothEntity.this.navigation.createPath(new BlockPos(vec3d), 1), 1.0D);
|
||||||
}
|
}
|
||||||
catch (Exception e) {}
|
catch (Exception e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,7 +276,8 @@ public class SilkMothEntity extends Animal implements FlyingAnimal {
|
||||||
SilkMothEntity.this.entrance = SilkMothEntity.this.hivePos.relative(state.getValue(BlockStateProperties.HORIZONTAL_FACING));
|
SilkMothEntity.this.entrance = SilkMothEntity.this.hivePos.relative(state.getValue(BlockStateProperties.HORIZONTAL_FACING));
|
||||||
SilkMothEntity.this.navigation.moveTo(SilkMothEntity.this.navigation.createPath(entrance, 1), 1.0D);
|
SilkMothEntity.this.navigation.moveTo(SilkMothEntity.this.navigation.createPath(entrance, 1), 1.0D);
|
||||||
}
|
}
|
||||||
catch (Exception e) {}
|
catch (Exception e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package ru.betterend.entity.model;
|
package ru.betterend.entity.model;
|
||||||
|
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
import net.minecraft.client.model.EntityModel;
|
import net.minecraft.client.model.EntityModel;
|
||||||
import net.minecraft.client.model.geom.ModelPart;
|
import net.minecraft.client.model.geom.ModelPart;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
|
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
public abstract class BlockBenchModel<T extends Entity> extends EntityModel<T> {
|
public abstract class BlockBenchModel<T extends Entity> extends EntityModel<T> {
|
||||||
public BlockBenchModel() {
|
public BlockBenchModel() {
|
||||||
super();
|
super();
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue