Merge remote-tracking branch 'upstream/master' into 1.17
This commit is contained in:
commit
9b92ad3967
8 changed files with 60 additions and 25 deletions
29
build.gradle
29
build.gradle
|
@ -42,39 +42,46 @@ dependencies {
|
||||||
|
|
||||||
def useOptional(String dep) {
|
def useOptional(String dep) {
|
||||||
dependencies.modRuntime (dep) {
|
dependencies.modRuntime (dep) {
|
||||||
exclude group: "net.fabricmc.fabric-api"
|
exclude group: 'net.fabricmc.fabric-api'
|
||||||
exclude group: "net.fabricmc"
|
exclude group: 'net.fabricmc'
|
||||||
if (!dep.contains("me.shedaniel")) {
|
if (!dep.contains("me.shedaniel")) {
|
||||||
exclude group: "me.shedaniel"
|
exclude group: 'me.shedaniel.cloth'
|
||||||
|
exclude group: 'me.shedaniel'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies.modCompileOnly (dep) {
|
dependencies.modCompileOnly (dep) {
|
||||||
exclude group: "net.fabricmc.fabric-api"
|
exclude group: 'net.fabricmc.fabric-api'
|
||||||
exclude group: "net.fabricmc"
|
exclude group: 'net.fabricmc'
|
||||||
if (!dep.contains("me.shedaniel")) {
|
if (!dep.contains("me.shedaniel")) {
|
||||||
exclude group: "me.shedaniel"
|
exclude group: 'me.shedaniel.cloth'
|
||||||
|
exclude group: 'me.shedaniel'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def useApi(String dep) {
|
def useApi(String dep) {
|
||||||
dependencies.modApi (dep) {
|
dependencies.modApi (dep) {
|
||||||
exclude group: "net.fabricmc.fabric-api"
|
exclude group: 'net.fabricmc.fabric-api'
|
||||||
exclude group: "net.fabricmc"
|
exclude group: 'net.fabricmc'
|
||||||
if (!dep.contains("me.shedaniel")) {
|
if (!dep.contains("me.shedaniel")) {
|
||||||
exclude group: "me.shedaniel"
|
exclude group: 'me.shedaniel.cloth'
|
||||||
|
exclude group: 'me.shedaniel'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
inputs.property "version", project.version
|
inputs.property "version", project.version
|
||||||
duplicatesStrategy = 'WARN'
|
duplicatesStrategy = 'EXCLUDE'
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
include "fabric.mod.json"
|
include "fabric.mod.json"
|
||||||
expand "version": project.version
|
expand "version": project.version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
|
exclude "fabric.mod.json"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
||||||
|
@ -154,4 +161,4 @@ task release(dependsOn: [remapJar, sourcesJar, javadocJar]) {
|
||||||
// // uncomment to publish to the local maven
|
// // uncomment to publish to the local maven
|
||||||
// // mavenLocal()
|
// // mavenLocal()
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
|
@ -16,6 +16,6 @@ archives_base_name = better-end
|
||||||
# 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 = 55-FABRIC-SNAPSHOT
|
patchouli_version = 55-FABRIC-SNAPSHOT
|
||||||
fabric_version = 0.36.1+1.17
|
fabric_version = 0.36.1+1.17
|
||||||
canvas_version = 1.0.+
|
|
||||||
bclib_version = 0.2.0
|
bclib_version = 0.2.0
|
||||||
rei_version = 6.0.262-alpha
|
rei_version = 6.0.262-alpha
|
||||||
|
canvas_version = 1.0.+
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
||||||
.resistance(100F)
|
.resistance(100F)
|
||||||
.requiresCorrectToolForDrops()
|
.requiresCorrectToolForDrops()
|
||||||
.sound(SoundType.STONE));
|
.sound(SoundType.STONE));
|
||||||
this.registerDefaultState(this.stateDefinition.any()
|
registerDefaultState(this.stateDefinition.any()
|
||||||
.setValue(FACING, Direction.NORTH)
|
.setValue(FACING, Direction.NORTH)
|
||||||
.setValue(LIT, false));
|
.setValue(LIT, false));
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||||
return this.defaultBlockState().setValue(FACING, ctx.getHorizontalDirection().getOpposite());
|
return defaultBlockState().setValue(FACING, ctx.getHorizontalDirection().getOpposite());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -274,7 +274,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
||||||
blockEntity.smeltTime = 0;
|
blockEntity.smeltTime = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
burning = blockEntity.isBurning();
|
||||||
if (initialBurning != burning) {
|
if (initialBurning != burning) {
|
||||||
tickLevel.setBlock(tickPos, tickState.setValue(EndStoneSmelter.LIT, burning), 3);
|
tickLevel.setBlock(tickPos, tickState.setValue(EndStoneSmelter.LIT, burning), 3);
|
||||||
blockEntity.setChanged();
|
blockEntity.setChanged();
|
||||||
|
|
|
@ -32,6 +32,7 @@ import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
import ru.betterend.BetterEnd;
|
||||||
import ru.betterend.interfaces.FallFlyingItem;
|
import ru.betterend.interfaces.FallFlyingItem;
|
||||||
import ru.betterend.interfaces.MobEffectApplier;
|
import ru.betterend.interfaces.MobEffectApplier;
|
||||||
import ru.betterend.item.CrystaliteArmor;
|
import ru.betterend.item.CrystaliteArmor;
|
||||||
|
@ -89,8 +90,12 @@ public abstract class LivingEntityMixin extends Entity {
|
||||||
|
|
||||||
@Inject(method = "canBeAffected", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "canBeAffected", at = @At("HEAD"), cancellable = true)
|
||||||
public void be_canBeAffected(MobEffectInstance mobEffectInstance, CallbackInfoReturnable<Boolean> info) {
|
public void be_canBeAffected(MobEffectInstance mobEffectInstance, CallbackInfoReturnable<Boolean> info) {
|
||||||
if (mobEffectInstance.getEffect() == MobEffects.BLINDNESS && getAttributes().getValue(EndAttributes.BLINDNESS_RESISTANCE) > 0.0) {
|
try {
|
||||||
info.setReturnValue(false);
|
if (mobEffectInstance.getEffect() == MobEffects.BLINDNESS && getAttributes().getValue(EndAttributes.BLINDNESS_RESISTANCE) > 0.0) {
|
||||||
|
info.setReturnValue(false);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
BetterEnd.LOGGER.warning("Blindness resistance attribute haven't been registered.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,11 +17,10 @@ import ru.bclib.util.ColorUtil;
|
||||||
import ru.betterend.registry.EndParticles;
|
import ru.betterend.registry.EndParticles;
|
||||||
|
|
||||||
public class InfusionParticleType extends ParticleType<InfusionParticleType> implements ParticleOptions {
|
public class InfusionParticleType extends ParticleType<InfusionParticleType> implements ParticleOptions {
|
||||||
public static final Codec<InfusionParticleType> CODEC = ItemStack.CODEC.xmap(itemStack -> {
|
public static final Codec<InfusionParticleType> CODEC = ItemStack.CODEC.xmap(
|
||||||
return new InfusionParticleType(EndParticles.INFUSION, itemStack);
|
itemStack -> new InfusionParticleType(EndParticles.INFUSION, itemStack),
|
||||||
}, infusionParticleType -> {
|
infusionParticleType -> infusionParticleType.itemStack);
|
||||||
return infusionParticleType.itemStack;
|
|
||||||
});
|
|
||||||
public static final ParticleOptions.Deserializer<InfusionParticleType> PARAMETERS_FACTORY = new ParticleOptions.Deserializer<InfusionParticleType>() {
|
public static final ParticleOptions.Deserializer<InfusionParticleType> PARAMETERS_FACTORY = new ParticleOptions.Deserializer<InfusionParticleType>() {
|
||||||
public InfusionParticleType fromCommand(ParticleType<InfusionParticleType> particleType, StringReader stringReader) throws CommandSyntaxException {
|
public InfusionParticleType fromCommand(ParticleType<InfusionParticleType> particleType, StringReader stringReader) throws CommandSyntaxException {
|
||||||
stringReader.expect(' ');
|
stringReader.expect(' ');
|
||||||
|
@ -35,8 +34,8 @@ public class InfusionParticleType extends ParticleType<InfusionParticleType> imp
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private ParticleType<InfusionParticleType> type;
|
private final ParticleType<InfusionParticleType> type;
|
||||||
private ItemStack itemStack;
|
private final ItemStack itemStack;
|
||||||
|
|
||||||
public InfusionParticleType(ParticleType<InfusionParticleType> particleType, ItemStack stack) {
|
public InfusionParticleType(ParticleType<InfusionParticleType> particleType, ItemStack stack) {
|
||||||
super(true, PARAMETERS_FACTORY);
|
super(true, PARAMETERS_FACTORY);
|
||||||
|
|
|
@ -4,9 +4,12 @@ import java.util.Objects;
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
import net.minecraft.nbt.TagParser;
|
||||||
import net.minecraft.network.FriendlyByteBuf;
|
import net.minecraft.network.FriendlyByteBuf;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.tags.Tag;
|
import net.minecraft.tags.Tag;
|
||||||
|
@ -276,6 +279,15 @@ public class AnvilRecipe implements Recipe<Container>, BetterEndRecipe {
|
||||||
if (output == null) {
|
if (output == null) {
|
||||||
throw new IllegalStateException("Output item does not exists!");
|
throw new IllegalStateException("Output item does not exists!");
|
||||||
}
|
}
|
||||||
|
if (result.has("nbt")) {
|
||||||
|
try {
|
||||||
|
String nbtData = GsonHelper.getAsString(result, "nbt");
|
||||||
|
CompoundTag nbt = TagParser.parseTag(nbtData);
|
||||||
|
output.setTag(nbt);
|
||||||
|
} catch (CommandSyntaxException ex) {
|
||||||
|
BetterEnd.LOGGER.warning("Error parse nbt data for output.", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
int inputCount = GsonHelper.getAsInt(json, "inputCount", 1);
|
int inputCount = GsonHelper.getAsInt(json, "inputCount", 1);
|
||||||
int toolLevel = GsonHelper.getAsInt(json, "toolLevel", 1);
|
int toolLevel = GsonHelper.getAsInt(json, "toolLevel", 1);
|
||||||
int anvilLevel = GsonHelper.getAsInt(json, "anvilLevel", 1);
|
int anvilLevel = GsonHelper.getAsInt(json, "anvilLevel", 1);
|
||||||
|
|
|
@ -4,10 +4,13 @@ import java.util.Arrays;
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
|
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.core.NonNullList;
|
import net.minecraft.core.NonNullList;
|
||||||
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
import net.minecraft.nbt.TagParser;
|
||||||
import net.minecraft.network.FriendlyByteBuf;
|
import net.minecraft.network.FriendlyByteBuf;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.util.GsonHelper;
|
import net.minecraft.util.GsonHelper;
|
||||||
|
@ -210,6 +213,15 @@ public class InfusionRecipe implements Recipe<InfusionRitual>, BetterEndRecipe {
|
||||||
if (recipe.output == null) {
|
if (recipe.output == null) {
|
||||||
throw new IllegalStateException("Output item does not exists!");
|
throw new IllegalStateException("Output item does not exists!");
|
||||||
}
|
}
|
||||||
|
if (result.has("nbt")) {
|
||||||
|
try {
|
||||||
|
String nbtData = GsonHelper.getAsString(result, "nbt");
|
||||||
|
CompoundTag nbt = TagParser.parseTag(nbtData);
|
||||||
|
recipe.output.setTag(nbt);
|
||||||
|
} catch (CommandSyntaxException ex) {
|
||||||
|
BetterEnd.LOGGER.warning("Error parse nbt data for output.", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
recipe.group = GsonHelper.getAsString(json, "group", GROUP);
|
recipe.group = GsonHelper.getAsString(json, "group", GROUP);
|
||||||
recipe.time = GsonHelper.getAsInt(json, "time", 1);
|
recipe.time = GsonHelper.getAsInt(json, "time", 1);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue