Start update
This commit is contained in:
parent
570e65ca47
commit
cbc91f4523
9 changed files with 42 additions and 30 deletions
10
build.gradle
10
build.gradle
|
@ -7,12 +7,12 @@ buildscript {
|
||||||
plugins {
|
plugins {
|
||||||
id 'idea'
|
id 'idea'
|
||||||
id 'eclipse'
|
id 'eclipse'
|
||||||
id 'fabric-loom' version '0.7-SNAPSHOT'
|
id 'fabric-loom' version '0.8-SNAPSHOT'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_16
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_16
|
||||||
|
|
||||||
archivesBaseName = project.archives_base_name
|
archivesBaseName = project.archives_base_name
|
||||||
version = project.mod_version
|
version = project.mod_version
|
||||||
|
@ -20,7 +20,7 @@ group = project.maven_group
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url "https://maven.dblsaiko.net/" }
|
maven { url "https://maven.dblsaiko.net/" }
|
||||||
maven { url "http://server.bbkr.space:8081/artifactory/libs-release/" }
|
maven { url "https://server.bbkr.space:8081/artifactory/libs-release/" }
|
||||||
maven { url "https://maven.fabricmc.net/" }
|
maven { url "https://maven.fabricmc.net/" }
|
||||||
maven { url 'https://maven.blamejared.com' }
|
maven { url 'https://maven.blamejared.com' }
|
||||||
maven { url "https://maven.shedaniel.me/" }
|
maven { url "https://maven.shedaniel.me/" }
|
||||||
|
@ -33,7 +33,7 @@ dependencies {
|
||||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||||
|
|
||||||
useApi "vazkii.patchouli:Patchouli:1.16.4-${project.patchouli_version}"
|
//useApi "vazkii.patchouli:Patchouli:1.16.4-${project.patchouli_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
def useOptional(String dep) {
|
def useOptional(String dep) {
|
||||||
|
|
|
@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx2G
|
||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/use
|
# check these on https://fabricmc.net/use
|
||||||
minecraft_version=1.16.5
|
minecraft_version= 1.17
|
||||||
yarn_mappings=6
|
yarn_mappings= 6
|
||||||
loader_version=0.11.3
|
loader_version= 0.11.6
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 0.1.38
|
mod_version = 0.1.38
|
||||||
|
@ -15,4 +15,4 @@ archives_base_name = bclib
|
||||||
# Dependencies
|
# Dependencies
|
||||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||||
patchouli_version = 50-FABRIC
|
patchouli_version = 50-FABRIC
|
||||||
fabric_version = 0.32.9+1.16
|
fabric_version = 0.35.2+1.17
|
||||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +1,5 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
package ru.bclib.blockentities;
|
package ru.bclib.blockentities;
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.entity.SignBlockEntity;
|
import net.minecraft.world.level.block.entity.SignBlockEntity;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import ru.bclib.registry.BaseBlockEntities;
|
import ru.bclib.registry.BaseBlockEntities;
|
||||||
|
|
||||||
public class BaseSignBlockEntity extends SignBlockEntity {
|
public class BaseSignBlockEntity extends SignBlockEntity {
|
||||||
public BaseSignBlockEntity() {
|
public BaseSignBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||||
super();
|
super(blockPos, blockState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -6,24 +6,39 @@ import java.util.function.Supplier;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
public class DynamicBlockEntityType<T extends BlockEntity> extends BlockEntityType<T> {
|
public class DynamicBlockEntityType<T extends BlockEntity> extends BlockEntityType<T> {
|
||||||
|
|
||||||
private final Set<Block> validBlocks = Sets.newHashSet();
|
private final Set<Block> validBlocks = Sets.newHashSet();
|
||||||
|
private final BlockEntitySupplier<? extends T> factory;
|
||||||
|
|
||||||
public DynamicBlockEntityType(Supplier<? extends T> supplier) {
|
public DynamicBlockEntityType(BlockEntitySupplier<? extends T> supplier) {
|
||||||
super(supplier, Collections.emptySet(), null);
|
super(null, Collections.emptySet(), null);
|
||||||
|
this.factory = supplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid(Block block) {
|
@Nullable public T create(BlockPos blockPos, BlockState blockState) {
|
||||||
return validBlocks.contains(block);
|
return factory.create(blockPos, blockState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isValid(BlockState blockState) {
|
||||||
|
return validBlocks.contains(blockState.getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerBlock(Block block) {
|
public void registerBlock(Block block) {
|
||||||
validBlocks.add(block);
|
validBlocks.add(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@FunctionalInterface
|
||||||
|
interface BlockEntitySupplier<T extends BlockEntity> {
|
||||||
|
T create(BlockPos blockPos, BlockState blockState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,8 +75,8 @@ public class BaseSignBlock extends SignBlock implements BlockModelProvider, ISpe
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockEntity newBlockEntity(BlockGetter world) {
|
public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||||
return new BaseSignBlockEntity();
|
return new BaseSignBlockEntity(blockPos, blockState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -85,7 +85,7 @@ public class BaseSignBlock extends SignBlock implements BlockModelProvider, ISpe
|
||||||
BaseSignBlockEntity sign = (BaseSignBlockEntity) world.getBlockEntity(pos);
|
BaseSignBlockEntity sign = (BaseSignBlockEntity) world.getBlockEntity(pos);
|
||||||
if (sign != null) {
|
if (sign != null) {
|
||||||
if (!world.isClientSide) {
|
if (!world.isClientSide) {
|
||||||
sign.setAllowedPlayerEditor((Player) placer);
|
sign.setAllowedPlayerEditor(placer.getUUID());
|
||||||
((ServerPlayer) placer).connection.send(new ClientboundOpenSignEditorPacket(pos));
|
((ServerPlayer) placer).connection.send(new ClientboundOpenSignEditorPacket(pos));
|
||||||
} else {
|
} else {
|
||||||
sign.setEditable(true);
|
sign.setEditable(true);
|
||||||
|
@ -166,12 +166,6 @@ public class BaseSignBlock extends SignBlock implements BlockModelProvider, ISpe
|
||||||
return Collections.singletonList(new ItemStack(this));
|
return Collections.singletonList(new ItemStack(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Fluid takeLiquid(LevelAccessor world, BlockPos pos, BlockState state) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.takeLiquid(world, pos, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) {
|
public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.world.level.block.state.properties.ChestType;
|
||||||
import ru.bclib.blockentities.BaseChestBlockEntity;
|
import ru.bclib.blockentities.BaseChestBlockEntity;
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public class BaseChestBlockEntityRenderer extends BlockEntityRenderer<BaseChestBlockEntity> {
|
public class BaseChestBlockEntityRenderer implements BlockEntityRenderer<BaseChestBlockEntity> {
|
||||||
private static final HashMap<Block, RenderType[]> LAYERS = Maps.newHashMap();
|
private static final HashMap<Block, RenderType[]> LAYERS = Maps.newHashMap();
|
||||||
private static final RenderType[] defaultLayer;
|
private static final RenderType[] defaultLayer;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.world.level.block.state.properties.WoodType;
|
||||||
import ru.bclib.blockentities.BaseSignBlockEntity;
|
import ru.bclib.blockentities.BaseSignBlockEntity;
|
||||||
import ru.bclib.blocks.BaseSignBlock;
|
import ru.bclib.blocks.BaseSignBlock;
|
||||||
|
|
||||||
public class BaseSignBlockEntityRenderer extends BlockEntityRenderer<BaseSignBlockEntity> {
|
public class BaseSignBlockEntityRenderer implements BlockEntityRenderer<BaseSignBlockEntity> {
|
||||||
private static final HashMap<Block, RenderType> LAYERS = Maps.newHashMap();
|
private static final HashMap<Block, RenderType> LAYERS = Maps.newHashMap();
|
||||||
private static final RenderType defaultLayer;
|
private static final RenderType defaultLayer;
|
||||||
private final SignModel model = new SignRenderer.SignModel();
|
private final SignModel model = new SignRenderer.SignModel();
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
package ru.bclib.items;
|
package ru.bclib.items;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
||||||
|
import net.minecraft.sounds.SoundEvents;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraft.world.item.FishBucketItem;
|
import net.minecraft.world.item.MobBucketItem;
|
||||||
import net.minecraft.world.level.material.Fluids;
|
import net.minecraft.world.level.material.Fluids;
|
||||||
import ru.bclib.client.models.ItemModelProvider;
|
import ru.bclib.client.models.ItemModelProvider;
|
||||||
|
|
||||||
public class BaseBucketItem extends FishBucketItem implements ItemModelProvider {
|
public class BaseBucketItem extends MobBucketItem implements ItemModelProvider {
|
||||||
public BaseBucketItem(EntityType<?> type, FabricItemSettings settings) {
|
public BaseBucketItem(EntityType<?> type, FabricItemSettings settings) {
|
||||||
super(type, Fluids.WATER, settings.stacksTo(1));
|
super(type, Fluids.WATER, SoundEvents.BUCKET_EMPTY_FISH, settings.stacksTo(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue