Skip to content

Commit

Permalink
[2.0.0-rc.6] Update to 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Feb 28, 2022
1 parent dacd67b commit 0fac1fd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ repositories {
}

mavenCentral()
//mavenLocal()
mavenLocal()
}

dependencies {
Expand All @@ -61,8 +61,9 @@ dependencies {
modImplementation include("eu.pb4:sgui:1.0.0+1.18.1")
modImplementation include("eu.pb4:hologram-api:0.2.1+1.18-pre5")
modImplementation include("eu.pb4:placeholder-api:1.1.3+1.17.1")
modImplementation include("eu.pb4:polymer:0.2.0-beta.27+1.18.1")
modImplementation include("fr.catcore:server-translations-api:1.4.8+1.18-pre1")
modImplementation include("eu.pb4:polymer:0.2.0-beta.27+1.18.2-rc1")
modImplementation include("fr.catcore:server-translations-api:1.4.9+1.18.2-rc1")
//modImplementation include("fr.catcore:server-translations-api:1.4.8+1.18-pre1")
modImplementation include("me.lucko:fabric-permissions-api:0.1-SNAPSHOT")

modCompileOnly "dev.emi:trinkets:3.0.4"
Expand Down
13 changes: 6 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.18.1
yarn_mappings=1.18.1+build.1
loader_version=0.12.8

#Fabric api
fabric_version=0.46.1+1.18
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.1
loader_version=0.13.3

#Fabric api
fabric_version=0.47.8+1.18.2
# Mod Properties
mod_version = 2.0.0-rc.5+1.18.1
mod_version = 2.0.0-rc.5+1.18.2
maven_group = eu.pb4
archives_base_name = graves

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/eu/pb4/graves/mixin/ServerWorldMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.profiler.Profiler;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.MutableWorldProperties;
import net.minecraft.world.World;
Expand All @@ -20,6 +21,10 @@

@Mixin(ServerWorld.class)
public abstract class ServerWorldMixin extends World {
protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey<World> registryRef, RegistryEntry<DimensionType> registryEntry, Supplier<Profiler> profiler, boolean isClient, boolean debugWorld, long seed) {
super(properties, registryRef, registryEntry, profiler, isClient, debugWorld, seed);
}

@Inject(method = "canPlayerModifyAt", at = @At("HEAD"), cancellable = true)
private void grave_disallowGraveBreaking(PlayerEntity player, BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
if (this.getBlockEntity(pos) instanceof GraveBlockEntity grave) {
Expand All @@ -33,8 +38,4 @@ private static void grave_dontBreak(ServerWorld serverWorld, BlockPos pos, Callb
ci.cancel();
}
}

protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey<World> registryRef, DimensionType dimensionType, Supplier<Profiler> profiler, boolean isClient, boolean debugWorld, long seed) {
super(properties, registryRef, dimensionType, profiler, isClient, debugWorld, seed);
}
}
8 changes: 4 additions & 4 deletions src/main/java/eu/pb4/graves/other/GraveUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import eu.pb4.graves.event.GraveValidPosCheckEvent;
import eu.pb4.graves.registry.SafeXPEntity;
import eu.pb4.graves.registry.TempBlock;
import net.fabricmc.fabric.api.tag.TagFactory;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.enchantment.Enchantment;
Expand All @@ -17,6 +16,7 @@
import net.minecraft.server.world.ServerWorld;
import net.minecraft.state.property.Property;
import net.minecraft.tag.Tag;
import net.minecraft.tag.TagKey;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
Expand All @@ -36,7 +36,7 @@

public class GraveUtils {
public static final Identifier REPLACEABLE_ID = new Identifier("universal_graves", "replaceable");
public static final Tag<Block> REPLACEABLE_TAG = TagFactory.BLOCK.create(GraveUtils.REPLACEABLE_ID);
public static final TagKey<Block> REPLACEABLE_TAG = TagKey.of(Registry.BLOCK_KEY, REPLACEABLE_ID);
private static final Function<Map.Entry<Property<?>, Comparable<?>>, String> PROPERTY_MAP_PRINTER = new Function<>() {
public String apply(@Nullable Map.Entry<Property<?>, Comparable<?>> entry) {
if (entry == null) {
Expand Down Expand Up @@ -117,10 +117,10 @@ public static void spawnExp(ServerWorld world, Vec3d pos, int amount) {
}


private static BlockResult isValidPos(ServerPlayerEntity player, ServerWorld world, WorldBorder border, BlockPos pos, boolean anyBlock) {
private static BlockResult isValidPos(ServerPlayerEntity player, ServerWorld world, WorldBorder border, BlockPos pos, boolean anyBlock) {
BlockState state = world.getBlockState(pos);

if (state.getBlock() != TempBlock.INSTANCE && border.contains(pos) && pos.getY() >= world.getBottomY() && pos.getY() < world.getTopY() && !state.hasBlockEntity() && (state.isAir() || anyBlock || REPLACEABLE_TAG.contains(state.getBlock()))) {
if (state.getBlock() != TempBlock.INSTANCE && border.contains(pos) && pos.getY() >= world.getBottomY() && pos.getY() < world.getTopY() && !state.hasBlockEntity() && (state.isAir() || anyBlock || state.isIn(REPLACEABLE_TAG))) {
return GraveValidPosCheckEvent.EVENT.invoker().isValid(player, world, pos);
} else {
return BlockResult.BLOCK;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"depends": {
"fabricloader": ">=0.12.0",
"fabric": "*",
"minecraft": ">=1.18-rc.1",
"minecraft": ">=1.18.2-rc.1",
"java": ">=17"
}
}

0 comments on commit 0fac1fd

Please sign in to comment.