Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

1.19.4 Update #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'fabric-loom' version '1.1-SNAPSHOT'
id 'maven-publish'
id "com.modrinth.minotaur" version "2.+"
//id 'com.matthewprenger.cursegradle' version '1.4.0'
Expand Down Expand Up @@ -29,11 +29,12 @@ dependencies {

//modCompileOnly 'curse.maven:repurposed-structures-fabric-391366:3542863'

modImplementation include("eu.pb4:sgui:1.1.0+1.19")
modImplementation include("eu.pb4:hologram-api:0.2.2+1.19")
modImplementation include("eu.pb4:polymer:0.2.0+1.19")
modImplementation include("fr.catcore:server-translations-api:1.4.14+1.19-rc2")
modImplementation include("me.lucko:fabric-permissions-api:0.1-SNAPSHOT")
modImplementation include("eu.pb4:sgui:1.2.1+1.19.3")
modImplementation include("eu.pb4:hologram-api:0.2.3+1.19.3")
modImplementation include("eu.pb4:polymer-common:0.4.9+1.19.4")
modImplementation include("eu.pb4:polymer-core:0.4.9+1.19.4")
modImplementation include("xyz.nucleoid:server-translations-api:2.0.0-beta.2+1.19.4-pre2")
modImplementation include("me.lucko:fabric-permissions-api:0.2-SNAPSHOT")
}

loom {
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
org.gradle.jvmargs=-Xmx2G
# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.19
yarn_mappings=1.19+build.1
loader_version=0.14.6
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.2
loader_version=0.14.19
# Mod Properties
mod_version=3.0.0
maven_group=eu.pb4.polymer-ports
archives_base_name=wraith-waystones
# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.55.1+1.19
fabric_version=0.81.1+1.19.4
# Optional Dependencies
# Journeymap & api
journeymap_api_version=1.18.2-1.8-fabric-SNAPSHOT
journeymap_api_version=1.19.4-1.9-fabric-SNAPSHOT
jm_project_id=32274
jm_file_id=3796377
jm_file_id=4444873
rs_project_id=391366
rs_file_id=3794326
rs_file_id=4465193

sub_version=0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 7 additions & 7 deletions src/main/java/wraith/fwaystones/block/WaystoneBlock.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package wraith.fwaystones.block;

import eu.pb4.polymer.api.block.PolymerBlock;
import eu.pb4.polymer.core.api.block.PolymerBlock;
import net.minecraft.block.*;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
Expand All @@ -15,6 +15,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.registry.Registries;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.state.StateManager;
Expand All @@ -31,9 +32,6 @@
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldAccess;
Expand Down Expand Up @@ -126,7 +124,7 @@ public BlockState getPlacementState(ItemPlacementContext ctx) {

if (blockPos.getY() < world.getTopY() - 1 && world.getBlockState(blockPos.up()).canReplace(ctx)) {
return this.getDefaultState()
.with(FACING, ctx.getPlayerFacing().getOpposite())
.with(FACING, ctx.getPlayerLookDirection().getOpposite())
.with(HALF, DoubleBlockHalf.LOWER)
.with(WATERLOGGED, fluidState.getFluid() == Fluids.WATER)
.with(ACTIVE, hasOwner);
Expand Down Expand Up @@ -251,7 +249,7 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt
var config = Config.getInstance();
var discoverItemId = config.getDiscoverItem();
if (discoverItemId != null && !player.isCreative()) {
var discoverItem = Registry.ITEM.get(discoverItemId);
var discoverItem = Registries.ITEM.get(discoverItemId);
var discoverAmount = config.getDiscoverItemAmount();
if (!Utils.containsItem(player.getInventory(), discoverItem, discoverAmount)) {
player.sendMessage(Text.translatable(
Expand Down Expand Up @@ -332,13 +330,15 @@ public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockSt
super.onStateReplaced(state, world, pos, newState, moved);
}

@Override
public FluidState getFluidState(BlockState state) {
return state.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state);
}

@Override
public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
if (state.get(WATERLOGGED)) {
world.createAndScheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world));
world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world));
}
return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import eu.pb4.holograms.api.elements.SpacingHologramElement;
import eu.pb4.holograms.api.holograms.WorldHologram;
import eu.pb4.polymer.api.utils.PolymerObject;
import eu.pb4.sgui.virtual.VirtualScreenHandlerInterface;
import eu.pb4.polymer.core.api.utils.PolymerObject;
import net.fabricmc.fabric.api.dimension.v1.FabricDimensions;
import net.fabricmc.fabric.api.util.NbtType;
import net.minecraft.block.BlockState;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/wraith/fwaystones/block/WaystoneStyle.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package wraith.fwaystones.block;

import net.minecraft.block.AbstractButtonBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.ButtonBlock;
import net.minecraft.block.WallBlock;
import net.minecraft.block.enums.WallMountLocation;
import net.minecraft.block.enums.WallShape;

public record WaystoneStyle(BlockState upper, BlockState lower, BlockState upperWater, BlockState lowerWater) {
public static WaystoneStyle simple(AbstractButtonBlock top, WallBlock bottom) {
var baseTop = top.getDefaultState().with(AbstractButtonBlock.FACE, WallMountLocation.FLOOR);
public static WaystoneStyle simple(ButtonBlock top, WallBlock bottom) {
var baseTop = top.getDefaultState().with(ButtonBlock.FACE, WallMountLocation.FLOOR);
var baseBottom = bottom.getDefaultState()
.with(WallBlock.UP, true)
.with(WallBlock.EAST_SHAPE, WallShape.LOW)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/wraith/fwaystones/gui/PagedGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ public static DisplayElement empty() {
}

public static final void playClickSound(ServerPlayerEntity player) {
player.playSound(SoundEvents.UI_BUTTON_CLICK, SoundCategory.MASTER, 1, 1);
player.playSound(SoundEvents.UI_BUTTON_CLICK.value(), SoundCategory.MASTER, 1, 1);
}
}
4 changes: 2 additions & 2 deletions src/main/java/wraith/fwaystones/gui/UniversalWaystoneGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import net.minecraft.enchantment.Enchantments;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.registry.Registries;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import net.minecraft.util.Hand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.registry.Registry;
import org.jetbrains.annotations.Nullable;
import wraith.fwaystones.FabricWaystones;
import wraith.fwaystones.access.PlayerAccess;
Expand Down Expand Up @@ -236,7 +236,7 @@ protected DisplayElement getCost() {
type = "level";
break;
case "item":
item = Registry.ITEM.get(Config.getInstance().teleportCostItem());
item = Registries.ITEM.get(Config.getInstance().teleportCostItem());
type = "item";
break;
default:
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/wraith/fwaystones/item/AbyssWatcherItem.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package wraith.fwaystones.item;

import eu.pb4.polymer.api.item.PolymerItem;
import eu.pb4.polymer.core.api.item.PolymerItem;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
Expand Down Expand Up @@ -37,9 +38,8 @@ public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity pla
return Items.ENDER_EYE;
}

@Override
public ItemStack getPolymerItemStack(ItemStack itemStack, @Nullable ServerPlayerEntity player) {
var stack = PolymerItem.super.getPolymerItemStack(itemStack, player);
public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipContext context, @Nullable ServerPlayerEntity player) {
var stack = PolymerItem.super.getPolymerItemStack(itemStack, context, player);
stack.addEnchantment(Enchantments.LURE, 2);
return stack;
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/wraith/fwaystones/item/LocalVoidItem.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package wraith.fwaystones.item;

import eu.pb4.polymer.api.item.PolymerItem;
import eu.pb4.polymer.core.api.item.PolymerItem;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.player.PlayerEntity;
Expand Down Expand Up @@ -109,8 +109,8 @@ public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity pla
}

@Override
public ItemStack getPolymerItemStack(ItemStack itemStack, @Nullable ServerPlayerEntity player) {
var stack = PolymerItem.super.getPolymerItemStack(itemStack, player);
public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipContext context, @Nullable ServerPlayerEntity player) {
var stack = PolymerItem.super.getPolymerItemStack(itemStack, context, player);
stack.addEnchantment(Enchantments.LURE, 2);
return stack;
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/wraith/fwaystones/item/PocketWormholeItem.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package wraith.fwaystones.item;

import eu.pb4.polymer.api.item.PolymerItem;
import eu.pb4.polymer.core.api.item.PolymerItem;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
Expand Down Expand Up @@ -37,9 +38,8 @@ public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity pla
return Items.ENDER_PEARL;
}

@Override
public ItemStack getPolymerItemStack(ItemStack itemStack, @Nullable ServerPlayerEntity player) {
var stack = PolymerItem.super.getPolymerItemStack(itemStack, player);
public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipContext context, @Nullable ServerPlayerEntity player) {
var stack = PolymerItem.super.getPolymerItemStack(itemStack, context, player);
stack.addEnchantment(Enchantments.LURE, 2);
return stack;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package wraith.fwaystones.item;

import eu.pb4.polymer.api.item.PolymerItem;
import eu.pb4.polymer.core.api.item.PolymerItem;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.player.PlayerEntity;
Expand Down Expand Up @@ -99,8 +99,8 @@ public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity pla
}

@Override
public ItemStack getPolymerItemStack(ItemStack itemStack, @Nullable ServerPlayerEntity player) {
var stack = PolymerItem.super.getPolymerItemStack(itemStack, player);
public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipContext context, @Nullable ServerPlayerEntity player) {
var stack = PolymerItem.super.getPolymerItemStack(itemStack, context, player);
stack.addEnchantment(Enchantments.LURE, 2);
return stack;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package wraith.fwaystones.item;

import eu.pb4.polymer.api.item.PolymerItem;
import eu.pb4.polymer.core.api.item.PolymerItem;
import net.minecraft.block.enums.DoubleBlockHalf;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.LivingEntity;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/wraith/fwaystones/item/WaystoneItem.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package wraith.fwaystones.item;

import eu.pb4.polymer.api.item.PolymerItem;
import eu.pb4.polymer.core.api.item.PolymerItem;
import net.minecraft.block.Block;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.enchantment.Enchantments;
Expand Down Expand Up @@ -48,8 +48,8 @@ public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity pla
}

@Override
public ItemStack getPolymerItemStack(ItemStack itemStack, @Nullable ServerPlayerEntity player) {
var stack = PolymerItem.super.getPolymerItemStack(itemStack, player);
public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipContext context, @Nullable ServerPlayerEntity player) {
var stack = PolymerItem.super.getPolymerItemStack(itemStack, context, player);
stack.addEnchantment(Enchantments.LURE, 2);
return stack;
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/wraith/fwaystones/item/WaystoneScrollItem.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package wraith.fwaystones.item;

import eu.pb4.polymer.api.item.PolymerItem;
import eu.pb4.polymer.core.api.item.PolymerItem;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.player.PlayerEntity;
Expand Down Expand Up @@ -142,8 +142,8 @@ public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity pla
}

@Override
public ItemStack getPolymerItemStack(ItemStack itemStack, @Nullable ServerPlayerEntity player) {
var stack = PolymerItem.super.getPolymerItemStack(itemStack, player);
public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipContext context, @Nullable ServerPlayerEntity player) {
var stack = PolymerItem.super.getPolymerItemStack(itemStack, context, player);
stack.addEnchantment(Enchantments.LURE, 2);
return stack;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/wraith/fwaystones/mixin/LivingEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.network.packet.s2c.play.EntityStatusS2CPacket;
import net.minecraft.registry.tag.DamageTypeTags;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Hand;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -82,7 +83,7 @@ public void revive(DamageSource source, CallbackInfoReturnable<Boolean> cir) {
}
}
}
cir.setReturnValue(teleported || !source.isOutOfWorld());
cir.setReturnValue(teleported || !source.isIn(DamageTypeTags.BYPASSES_INVULNERABILITY));
cir.cancel();
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/wraith/fwaystones/mixin/PlayerEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.nbt.NbtList;
import net.minecraft.nbt.NbtString;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.registry.tag.DamageTypeTags;
import net.minecraft.server.network.ServerPlayerEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand Down Expand Up @@ -48,7 +49,7 @@ public void tick(CallbackInfo ci) {

@Inject(method = "applyDamage", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;applyArmorToDamage(Lnet/minecraft/entity/damage/DamageSource;F)F"))
public void applyDamage(DamageSource source, float amount, CallbackInfo ci) {
if (source == DamageSource.OUT_OF_WORLD) {
if (source.isIn(DamageTypeTags.BYPASSES_INVULNERABILITY)) {
return;
}
setTeleportCooldown(Config.getInstance().getCooldownWhenHurt());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package wraith.fwaystones.mixin;

import net.minecraft.registry.Registry;
import net.minecraft.structure.PoolStructurePiece;
import net.minecraft.structure.StructureTemplateManager;
import net.minecraft.structure.pool.StructurePool;
import net.minecraft.structure.pool.StructurePoolBasedGenerator;
import net.minecraft.util.math.random.Random;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.HeightLimitView;
import net.minecraft.world.gen.chunk.ChunkGenerator;
Expand All @@ -25,7 +25,7 @@
@Mixin(StructurePoolBasedGenerator.class)
public class StructurePoolBasedGeneratorMixin {

@Inject(method = "generate(Lnet/minecraft/world/gen/noise/NoiseConfig;IZLnet/minecraft/world/gen/chunk/ChunkGenerator;Lnet/minecraft/structure/StructureTemplateManager;Lnet/minecraft/world/HeightLimitView;Lnet/minecraft/util/math/random/Random;Lnet/minecraft/util/registry/Registry;Lnet/minecraft/structure/PoolStructurePiece;Ljava/util/List;Lnet/minecraft/util/shape/VoxelShape;)V",
@Inject(method = "generate(Lnet/minecraft/world/gen/noise/NoiseConfig;IZLnet/minecraft/world/gen/chunk/ChunkGenerator;Lnet/minecraft/structure/StructureTemplateManager;Lnet/minecraft/world/HeightLimitView;Lnet/minecraft/util/math/random/Random;Lnet/minecraft/registry/Registry;Lnet/minecraft/structure/PoolStructurePiece;Ljava/util/List;Lnet/minecraft/util/shape/VoxelShape;)V",
at = @At(value = "INVOKE", target = "Ljava/util/Deque;addLast(Ljava/lang/Object;)V"),
locals = LocalCapture.CAPTURE_FAILSOFT)
private static void preGenerate2(NoiseConfig noiseConfig, int maxSize, boolean modifyBoundingBox, ChunkGenerator chunkGenerator, StructureTemplateManager structureTemplateManager, HeightLimitView heightLimitView, Random random, Registry<StructurePool> structurePoolRegistry, PoolStructurePiece firstPiece, List<PoolStructurePiece> pieces, VoxelShape pieceShape, CallbackInfo ci, StructurePoolBasedGenerator.StructurePoolGenerator structurePoolGenerator) {
Expand Down
Loading