Utils ported

This commit is contained in:
Sebastian Hartte
2020-06-28 15:47:44 +02:00
parent 46955643b9
commit f5412152a4
132 changed files with 488 additions and 528 deletions
@@ -26,8 +26,8 @@ import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.renderer.RenderTypeLookup;
import net.minecraft.item.*;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.Tag;
import net.minecraft.tag.BlockTags;
import net.minecraft.tag.Tag;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Identifier;
import net.minecraft.util.NonNullList;
@@ -31,7 +31,7 @@ import net.minecraft.text.TranslatableText;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.text.Text;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.WorldView;
import net.minecraft.world.World;
import net.fabricmc.api.Environment;
@@ -184,7 +184,7 @@ public class MemoryCardItem extends AEBaseItem implements IMemoryCard {
}
@Override
public boolean doesSneakBypassUse(ItemStack stack, IWorldReader world, BlockPos pos, PlayerEntity player) {
public boolean doesSneakBypassUse(ItemStack stack, WorldView world, BlockPos pos, PlayerEntity player) {
return true;
}
@@ -32,7 +32,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.hit.HitResult;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.WorldView;
import net.minecraft.world.World;
import appeng.api.implementations.guiobjects.IGuiItem;
@@ -112,7 +112,7 @@ public class NetworkToolItem extends AEBaseItem implements IGuiItem, IAEWrench {
}
@Override
public boolean doesSneakBypassUse(ItemStack stack, IWorldReader world, BlockPos pos, PlayerEntity player) {
public boolean doesSneakBypassUse(ItemStack stack, WorldView world, BlockPos pos, PlayerEntity player) {
return true;
}
@@ -132,7 +132,7 @@ public class NetworkToolItem extends AEBaseItem implements IGuiItem, IAEWrench {
final BlockEntity te = w.getBlockEntity(pos);
if (!(te instanceof IGridHost)) {
if (bs.rotate(w, pos, Rotation.CLOCKWISE_90) != bs) {
bs.neighborChanged(w, pos, Blocks.AIR, pos, false);
bs.neighborUpdate(w, pos, Blocks.AIR, pos, false);
p.swingArm(hand);
return !w.isClient;
}
@@ -64,9 +64,9 @@ import net.minecraft.item.ItemUsageContext;
import net.minecraft.item.SnowballItem;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.state.IProperty;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.Tag;
import net.minecraft.state.property.Property;
import net.minecraft.tag.ItemTags;
import net.minecraft.tag.Tag;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.ActionResult;
@@ -327,7 +327,7 @@ public class ColorApplicatorItem extends AEBasePoweredItem
Block recolored = BlockRecolorer.recolor(blk, newColor);
if (recolored != blk) {
BlockState newState = recolored.getDefaultState();
for (IProperty<?> prop : newState.getProperties()) {
for (Property<?> prop : newState.getProperties()) {
newState = copyProp(state, newState, prop);
}
@@ -353,8 +353,8 @@ public class ColorApplicatorItem extends AEBasePoweredItem
}
private static <T extends Comparable<T>> BlockState copyProp(BlockState oldState, BlockState newState,
IProperty<T> prop) {
if (newState.has(prop)) {
Property<T> prop) {
if (newState.contains(prop)) {
return newState.with(prop, oldState.get(prop));
}
return newState;
@@ -34,8 +34,9 @@ import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.*;
import net.minecraft.item.crafting.FurnaceRecipe;
import net.minecraft.recipe.RecipeType;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.sound.SoundEvents;
import net.minecraft.state.property.Properties;
import net.minecraft.util.*;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
@@ -89,7 +90,7 @@ public class EntropyManipulatorItem extends AEBasePoweredItem implements IBlockT
this.heatUp.put(new InWorldToolOperationIngredient(Blocks.WATER, Fluids.FLOWING_WATER),
new InWorldToolOperationResult());
this.heatUp.put(new InWorldToolOperationIngredient(Blocks.SNOW), new InWorldToolOperationResult(
Blocks.WATER.getDefaultState().with(BlockStateProperties.LEVEL_0_15, 7), Fluids.FLOWING_WATER));
Blocks.WATER.getDefaultState().with(Properties.LEVEL_0_15, 7), Fluids.FLOWING_WATER));
}
private static class InWorldToolOperationIngredient {