1.0.24
RelicCraft/pipeline/head This commit looks good Details

Fix Teleportation Restrictor only affecting living entities
This commit is contained in:
TheBrokenRail 2020-04-16 12:17:12 -04:00
parent feac2483bb
commit e77c6bff2e
4 changed files with 8 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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();
} }
} }