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 {
|
||||
id 'idea'
|
||||
id 'eclipse'
|
||||
id 'fabric-loom' version '0.7-SNAPSHOT'
|
||||
id 'fabric-loom' version '0.8-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_16
|
||||
targetCompatibility = JavaVersion.VERSION_16
|
||||
|
||||
archivesBaseName = project.archives_base_name
|
||||
version = project.mod_version
|
||||
|
@ -20,7 +20,7 @@ group = project.maven_group
|
|||
|
||||
repositories {
|
||||
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.blamejared.com' }
|
||||
maven { url "https://maven.shedaniel.me/" }
|
||||
|
@ -33,7 +33,7 @@ dependencies {
|
|||
modImplementation "net.fabricmc:fabric-loader:${project.loader_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) {
|
||||
|
|
|
@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx2G
|
|||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/use
|
||||
minecraft_version=1.16.5
|
||||
yarn_mappings=6
|
||||
loader_version=0.11.3
|
||||
minecraft_version= 1.17
|
||||
yarn_mappings= 6
|
||||
loader_version= 0.11.6
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 0.1.38
|
||||
|
@ -15,4 +15,4 @@ archives_base_name = bclib
|
|||
# Dependencies
|
||||
# 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
|
||||
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
|
||||
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
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package ru.bclib.blockentities;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.entity.SignBlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.registry.BaseBlockEntities;
|
||||
|
||||
public class BaseSignBlockEntity extends SignBlockEntity {
|
||||
public BaseSignBlockEntity() {
|
||||
super();
|
||||
public BaseSignBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||
super(blockPos, blockState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,24 +6,39 @@ import java.util.function.Supplier;
|
|||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
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> {
|
||||
|
||||
private final Set<Block> validBlocks = Sets.newHashSet();
|
||||
private final BlockEntitySupplier<? extends T> factory;
|
||||
|
||||
public DynamicBlockEntityType(Supplier<? extends T> supplier) {
|
||||
super(supplier, Collections.emptySet(), null);
|
||||
public DynamicBlockEntityType(BlockEntitySupplier<? extends T> supplier) {
|
||||
super(null, Collections.emptySet(), null);
|
||||
this.factory = supplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(Block block) {
|
||||
return validBlocks.contains(block);
|
||||
@Nullable public T create(BlockPos blockPos, BlockState blockState) {
|
||||
return factory.create(blockPos, blockState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(BlockState blockState) {
|
||||
return validBlocks.contains(blockState.getBlock());
|
||||
}
|
||||
|
||||
public void registerBlock(Block 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
|
||||
public BlockEntity newBlockEntity(BlockGetter world) {
|
||||
return new BaseSignBlockEntity();
|
||||
public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||
return new BaseSignBlockEntity(blockPos, blockState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -85,7 +85,7 @@ public class BaseSignBlock extends SignBlock implements BlockModelProvider, ISpe
|
|||
BaseSignBlockEntity sign = (BaseSignBlockEntity) world.getBlockEntity(pos);
|
||||
if (sign != null) {
|
||||
if (!world.isClientSide) {
|
||||
sign.setAllowedPlayerEditor((Player) placer);
|
||||
sign.setAllowedPlayerEditor(placer.getUUID());
|
||||
((ServerPlayer) placer).connection.send(new ClientboundOpenSignEditorPacket(pos));
|
||||
} else {
|
||||
sign.setEditable(true);
|
||||
|
@ -166,12 +166,6 @@ public class BaseSignBlock extends SignBlock implements BlockModelProvider, ISpe
|
|||
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
|
||||
public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.world.level.block.state.properties.ChestType;
|
|||
import ru.bclib.blockentities.BaseChestBlockEntity;
|
||||
|
||||
@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 RenderType[] defaultLayer;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.world.level.block.state.properties.WoodType;
|
|||
import ru.bclib.blockentities.BaseSignBlockEntity;
|
||||
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 RenderType defaultLayer;
|
||||
private final SignModel model = new SignRenderer.SignModel();
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
package ru.bclib.items;
|
||||
|
||||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
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 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) {
|
||||
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