Fix Teleportation Restrictor only affecting living entities
This commit is contained in:
parent
feac2483bb
commit
e77c6bff2e
@ -1,5 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
**1.0.24**
|
||||||
|
* Fix Teleportation Restrictor only affecting living entities
|
||||||
|
|
||||||
**1.0.23**
|
**1.0.23**
|
||||||
* Remove Max Count Limit From The Creative Relic Generator
|
* Remove Max Count Limit From The Creative Relic Generator
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
|||||||
fabric_loader_version = 0.7.10+build.191
|
fabric_loader_version = 0.7.10+build.191
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.0.23
|
mod_version = 1.0.24
|
||||||
maven_group = com.thebrokenrail
|
maven_group = com.thebrokenrail
|
||||||
archives_base_name = reliccraft
|
archives_base_name = reliccraft
|
||||||
|
|
||||||
|
@ -53,11 +53,7 @@ public abstract class AbstractDragonEggHolderBlock extends Block implements Bloc
|
|||||||
ItemStack stack = user.getStackInHand(hand);
|
ItemStack stack = user.getStackInHand(hand);
|
||||||
|
|
||||||
if (inventory.isValidInvStack(0, stack) && inventory.getInvStack(0).isEmpty()) {
|
if (inventory.isValidInvStack(0, stack) && inventory.getInvStack(0).isEmpty()) {
|
||||||
if (user.isCreative()) {
|
inventory.setInvStack(0, stack.split(1));
|
||||||
inventory.setInvStack(0, stack.copy().split(1));
|
|
||||||
} else {
|
|
||||||
inventory.setInvStack(0, stack.split(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!world.isClient()) {
|
if (!world.isClient()) {
|
||||||
grantAdvancement(user);
|
grantAdvancement(user);
|
||||||
|
@ -4,7 +4,7 @@ import com.thebrokenrail.reliccraft.RelicCraft;
|
|||||||
import net.fabricmc.fabric.api.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.Material;
|
import net.minecraft.block.Material;
|
||||||
import net.minecraft.block.MaterialColor;
|
import net.minecraft.block.MaterialColor;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.inventory.Inventory;
|
import net.minecraft.inventory.Inventory;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
@ -29,8 +29,8 @@ public class TeleportationRestrictorBlock extends AbstractDragonEggHolderBlock {
|
|||||||
public void tick(World world, BlockPos pos, Inventory inventory) {
|
public void tick(World world, BlockPos pos, Inventory inventory) {
|
||||||
int radius = !inventory.getInvStack(0).isEmpty() ? 128 : 0;
|
int radius = !inventory.getInvStack(0).isEmpty() ? 128 : 0;
|
||||||
Box box = new Box(pos).expand(radius);
|
Box box = new Box(pos).expand(radius);
|
||||||
List<LivingEntity> list = world.getNonSpectatingEntities(LivingEntity.class, box);
|
List<Entity> list = world.getNonSpectatingEntities(Entity.class, box);
|
||||||
for (LivingEntity entity : list) {
|
for (Entity entity : list) {
|
||||||
((TeleportingEntity) entity).resetTeleportCooldown();
|
((TeleportingEntity) entity).resetTeleportCooldown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user