Jump to content

Recommended Posts

Posted
7 minutes ago, BeardlessBrady said:

It seems that AtlasTexture and ModelLoader.instance().getSpriteMap... is no longer the same as your guide. Do you know how accessing those things have changed?

It seems to still be correct for me

 

// we have previously registered digitsTexture in StartupClientOnly::onTextureStitchEvent
AtlasTexture blocksStitchedTextures = ModelLoader.instance().getSpriteMap().getAtlasTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
TextureAtlasSprite digitsTextures = blocksStitchedTextures.getSprite(digitsTextureRL);

These compile fine

 

Check you build.gradle?

 

mappings channel: 'snapshot', version: '20200514-1.15.1'
minecraft 'net.minecraftforge:forge:1.15.2-31.2.0'

 

@OnlyIn(Dist.CLIENT)
public class AtlasTexture extends Texture implements ITickable {
   private static final Logger LOGGER = LogManager.getLogger();
   @Deprecated
   public static final ResourceLocation LOCATION_BLOCKS_TEXTURE = PlayerContainer.LOCATION_BLOCKS_TEXTURE;
   @Deprecated
   public static final ResourceLocation LOCATION_PARTICLES_TEXTURE = new ResourceLocation("textures/atlas/particles.png");
   private final List<TextureAtlasSprite> listAnimatedSprites = Lists.newArrayList();
   private final Set<ResourceLocation> sprites = Sets.newHashSet();
   private final Map<ResourceLocation, TextureAtlasSprite> mapUploadedSprites = Maps.newHashMap();
   private final ResourceLocation textureLocation;
   private final int maximumTextureSize;

   public AtlasTexture(ResourceLocation textureLocationIn) {
      this.textureLocation = textureLocationIn;
      this.maximumTextureSize = RenderSystem.maxSupportedTextureSize();
   }

and

ModelBakery::

public SpriteMap getSpriteMap() {
   return this.spriteMap;
}

Posted (edited)

Also I just want to make sure I'm doing this efficiently. I'm trying to dynamically create a texture in game. Is the best way to do it like your example where instead of filling a chess board with diamond blocks (I'll use a blank texture), the blocks will represent each individual pixel.

 

If you get what I mean would adding these many quads cause any lag or am I doing this wrong/not efficiently?

Edited by BeardlessBrady

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.