Lots of compile fixes

This commit is contained in:
Sebastian Hartte
2020-06-04 03:02:48 +02:00
parent 6eb2a9504a
commit 237463dd94
241 changed files with 3438 additions and 3474 deletions
@@ -46,8 +46,12 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.wrapper.RangedWrapper;
@@ -1139,7 +1143,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
this.craftingTracker.jobStateChange( link );
}
public String getTermName()
public ITextComponent getTermName()
{
final TileEntity hostTile = this.iHost.getTileEntity();
final World hostWorld = hostTile.getWorld();
@@ -1211,18 +1215,18 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
if( what.getItem() != Items.AIR )
{
return what.getTranslationKey();
return new TranslationTextComponent(what.getTranslationKey());
}
final Item item = Item.getItemFromBlock( directedBlock );
if( item == Items.AIR )
{
return directedBlock.getTranslationKey();
return new TranslationTextComponent(directedBlock.getTranslationKey());
}
}
}
return "Nothing";
return new StringTextComponent("Nothing");
}
public long getSortValue()
@@ -1262,17 +1266,17 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
}
@SuppressWarnings( "unchecked" )
public <T> T getCapability( Capability<T> capabilityClass, Direction facing )
public <T> LazyOptional<T> getCapability(Capability<T> capabilityClass, Direction facing )
{
if( capabilityClass == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY )
{
return (T) this.storage;
return (LazyOptional<T>) LazyOptional.of(() -> this.storage);
}
else if( capabilityClass == Capabilities.STORAGE_MONITORABLE_ACCESSOR )
{
return (T) this.accessor;
return (LazyOptional<T>) LazyOptional.of(() -> this.accessor);
}
return null;
return LazyOptional.empty();
}
private class InterfaceRequestSource extends MachineSource
@@ -19,10 +19,12 @@
package appeng.helpers;
import net.minecraft.util.text.ITextComponent;
public interface ICustomNameObject
{
String getCustomInventoryName();
ITextComponent getCustomInventoryName();
boolean hasCustomInventoryName();
}
@@ -21,7 +21,7 @@ package appeng.helpers;
import net.minecraft.item.ItemStack;
import appeng.core.sync.GuiBridge;
public interface IPriorityHost
@@ -39,5 +39,6 @@ public interface IPriorityHost
ItemStack getItemStackRepresentation();
GuiBridge getGuiBridge();
// FIXME Needs to be wired up to the static method in containers somehow
// FIXME GuiBridge getGuiBridge();
}
@@ -19,15 +19,16 @@
package appeng.helpers;
import java.util.ArrayList;
import java.util.List;
import appeng.util.Platform;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.ListNBT;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import appeng.util.Platform;
import java.util.ArrayList;
import java.util.List;
public class InvalidPatternHelper
@@ -117,9 +118,10 @@ public class InvalidPatternHelper
return !this.stack.isEmpty();
}
public String getName()
public ITextComponent getName()
{
return this.isValid() ? Platform.getItemDisplayName( this.stack ) : this.id + '@' + String.valueOf( this.getDamage() );
return this.isValid() ? Platform.getItemDisplayName( this.stack.getDisplayName() )
: new StringTextComponent(this.id + '@' + this.getDamage());
}
public int getDamage()
@@ -142,13 +144,13 @@ public class InvalidPatternHelper
return this.stack;
}
public String getFormattedToolTip()
public ITextComponent getFormattedToolTip()
{
String result = String.valueOf( this.getCount() ) + ' ' + this.getName();
ITextComponent result = new StringTextComponent( this.getCount() + " " ).appendSibling( this.getName() );
if( !this.isValid() )
{
result = TextFormatting.RED + ( ' ' + result );
result.applyTextStyle(TextFormatting.RED);
}
return result;