Rendering/Model Fixes

This commit is contained in:
Sebastian Hartte
2020-07-18 18:44:10 +02:00
parent 1e20cd8c08
commit 19802b96e8
61 changed files with 499 additions and 495 deletions
+1 -5
View File
@@ -23,8 +23,6 @@
package appeng.api;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
/**
* Every AE2 addon requiring access to {@link IAppEngApi}, needs to provide at
* least one class implementing this interface.
@@ -37,9 +35,7 @@ public interface IAEAddon {
/**
* This gets called once the API is successfully constructed and ready to be
* used.
*
* For now this happens during {@link FMLCommonSetupEvent}.
*
*
* Each addon is responsible to maintain a reference to {@link IAppEngApi} for
* future use. Otherwise there is no alternative to access it later.
*
@@ -28,9 +28,8 @@ import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Identifier;
/**
* A registry for 3D models used to render storage cells in the world, when they
@@ -46,8 +45,8 @@ public interface ICellModelRegistry {
* the game. See
* {@see net.minecraftforge.client.model.ModelLoader#addSpecialModel}.
*
* This method only maps an {@link Item} to a {@link ResourceLocation} which can
* be looked up from the {@link ModelBakery}. No validation about missing models
* This method only maps an {@link Item} to a {@link Identifier} which can
* be looked up from the {@link net.minecraft.client.render.model.BakedModelManager}. No validation about missing models
* will be done.
*
* Will throw an exception in case a model is already registered for an item.
@@ -55,20 +54,20 @@ public interface ICellModelRegistry {
* For examples look at our cell part models within the drive model directory.
*
* @param item The cell item
* @param model The {@link ResourceLocation} representing the model.
* @param model The {@link net.minecraft.util.Identifier} representing the model.
* @return
*/
void registerModel(@Nonnull Item item, @Nonnull ResourceLocation model);
void registerModel(@Nonnull Item item, @Nonnull Identifier model);
/**
* The {@link ResourceLocation} of the model used to render the given storage
* The {@link Identifier} of the model used to render the given storage
* cell {@link Item} when inserted into a drive or similar.
*
* @param item
* @return null, if no model is registered.
*/
@Nullable
ResourceLocation model(@Nonnull Item item);
Identifier model(@Nonnull Item item);
/**
* An unmodifiable map of all registered mappings.
@@ -76,13 +75,13 @@ public interface ICellModelRegistry {
* @return
*/
@Nonnull
Map<Item, ResourceLocation> models();
Map<Item, Identifier> models();
/**
* Returns the default model, which can be used when no explicit model is
* registered.
*/
@Nonnull
ResourceLocation getDefaultModel();
Identifier getDefaultModel();
}
+3 -3
View File
@@ -40,7 +40,7 @@ import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemConvertible;
import net.minecraft.text.Text;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.text.TranslatableText;
public enum Upgrades {
/**
@@ -167,8 +167,8 @@ public enum Upgrades {
return item != null && this.item == item;
}
public ITextComponent getTooltipGroup() {
return this.tooltipGroup != null ? new TranslationTextComponent(this.tooltipGroup) : null;
public Text getTooltipGroup() {
return this.tooltipGroup != null ? new TranslatableText(this.tooltipGroup) : null;
}
}
@@ -27,7 +27,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.ICraftingRecipe;
import net.minecraft.recipe.CraftingRecipe;
import net.minecraft.world.World;
import appeng.api.networking.crafting.ICraftingPatternDetails;
@@ -74,8 +74,8 @@ public interface ICraftingHelper {
* @param allowSubstitutes Controls whether the ME system will allow the use of
* equivalent items to craft this recipe.
*/
ItemStack encodeCraftingPattern(@Nullable ItemStack stack, ICraftingRecipe recipe, ItemStack[] in, ItemStack out,
boolean allowSubstitutes);
ItemStack encodeCraftingPattern(@Nullable ItemStack stack, CraftingRecipe recipe, ItemStack[] in, ItemStack out,
boolean allowSubstitutes);
/**
* Same as {@link #decodePattern(ItemStack, World, boolean)} with no auto
@@ -94,7 +94,7 @@ public interface ICraftingHelper {
*
* @param itemStack pattern
* @param world world used to access the
* {@link net.minecraft.item.crafting.RecipeManager}.
* {@link net.minecraft.recipe.RecipeManager}.
* @param autoRecovery If true, the method will try to recover from changed
* recipe ids by searching the entire recipe manager for a
* recipe matching the inputs. If this is successful, the