Jump to content

drazuam

Members
  • Posts

    18
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

drazuam's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Figured it out. ResourceLocation is expecting "symbols/symbol_x" instead of "textures/symbols/symbol_x.png". Apparently it knows where the textures are at.
  2. I'm trying to register a sprite to a Texture Atlas to draw later on. Here is my stitching code: @Mod.EventBusSubscriber(modid = MODID, value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD) public class SymbolTextures { public static final ResourceLocation DEBUG = new ResourceLocation(MODID , "textures/symbols/symbol_x.png"); @SubscribeEvent public static void onStitchEvent(TextureStitchEvent.Pre event) { ResourceLocation stitching = event.getMap().getTextureLocation(); if(!stitching.equals(AtlasTexture.LOCATION_BLOCKS_TEXTURE)) { return; } //TODO do this programmatically from registry boolean added = event.addSprite(DEBUG); } } (added ends up as true here) And here is where I'm trying to grab it: public static void renderSymbol(DrawnSymbol symbol, MatrixStack matrix) { assert Minecraft.getInstance().world != null; IRenderTypeBuffer buffer = Minecraft.getInstance().getRenderTypeBuffers().getBufferSource(); IVertexBuilder builder = buffer.getBuffer(RenderType.getTranslucent()); TextureAtlasSprite sprite = Minecraft.getInstance().getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(symbol.getTexture()); } in this case, symbol.getTexture() will return SymbolTextures.DEBUG. I only ever get "minecraft:missingno" returned as sprite. Does anybody have some experience with this? Am I doing something wrong?
  3. Figured it out. Seems like the Registry Event is not on the normal Event Bus, and you have to use FMLJavaModLoadingContext.get().getModEventBus().addListener() In order to properly access it.
  4. I'm trying to create a new registry... Which I think I've mostly got down besides one thorn in my side - I can seem to get the RegisterEvent.NewRegistry Event to trigger. Here is my Event Handler: public class CommonEventHandler { @SubscribeEvent public void onChunkAttachCapabilitiesEvent(AttachCapabilitiesEvent<Chunk> evt) { evt.addCapability(SymbolHandler.Provider.NAME, new SymbolHandler.Provider()); } @SubscribeEvent public void onCreateRegistryEvent(RegistryEvent.NewRegistry evt) { SymbolRegistration.onCreateRegistryEvent(evt); } @SubscribeEvent public void onSymbolRegistryEvent(RegistryEvent.Register<Symbol> evt) { SymbolRegistration.registerSymbols(evt); } } And here is where I register the handler: @Mod("runicarcana") public class RunicArcana { // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public static final String MODID = "runicarcana"; //Capability Registration @CapabilityInject(ISymbolHandler.class) public static Capability<ISymbolHandler> SYMBOL_CAP = null; public RunicArcana() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register the enqueueIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC); // Register the processIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC); // Register the doClientStuff method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new CommonEventHandler()); MinecraftForge.EVENT_BUS.register(new ClientEventHandler()); Registration.init(); } (I know it's messy right now... I'll clean it up [eventually]) Does anybody out there know why I can't seem to get RegistryEvent.NewRegistry to trigger? Any help is greatly appreciated!
  5. Woo! I think well, time to get learnin about android and things
  6. I'd like to create an android app for minecraft. I'd rather not go into too much detail... But the app on the tablet would need to communicate via wifi with the minecraft client. Possibly usb. I know it's possible to set up a server that you can connect to with an android device over wifi, but is it possible to start that service from within the minecraft jar?
  7. Sorry, what I meant is it's a client-side utility for use on a server lol so like rei's minimap, for example.
  8. Dang. This mod was meant to be used on a server lol. I'll just go ahead an actually learn something I suppose Basically, I'm going to try to recreate or update Keepcalm's block break api
  9. too lazy to type out full code *yawn* Also, I'm not sure if the tessellator takes partial ticks into account. I've just heard nasty things about it so I dont really ever plan on using it. I guess I'm just one paranoid fellow. I'll grind out the openGL for now, or at least until my fingers get numb. if it doesn't take into account partial ticks, heres some code to help you out: //get the villager variable in whatever way you do it... not sure how you have it set up. EntityClientPlayerMP player = mc.thePlayer; double diffX = (villager.prevPosX + (villager.posX - villager.prevPosX) * partialTicks) - (player.prevPosX + (player.posX - player.prevPosX) * partialTicks); double diffY = (villager.prevPosY + (villager.posY - villager.prevPosY) * partialTicks) - (player.prevPosY + (player.posY - player.prevPosY) * partialTicks); double diffZ = (villager.prevPosZ + (villager.posZ - villager.prevPosZ) * partialTicks) - (player.prevPosZ + (player.posZ - player.prevPosZ) * partialTicks); edit: you get partialticks for this from the event renderWorldLastEvent
  10. I think I might use ogl for something like this. It's a little dirtier, but you're allowed more flexibility. here's some example code: @ForgeSubscribe public void render(RenderWorldLastEvent event) { //allows for rendering relative to you EntityClientPlayerMP player = mc.thePlayer; double playerX = player.prevPosX + (player.posX - player.prevPosX) * event.partialTicks; double playerY = player.prevPosY + (player.posY - player.prevPosY) * event.partialTicks; double playerZ = player.prevPosZ + (player.posZ - player.prevPosZ) * event.partialTicks; //keep in mind that the event.partial ticks is important - it's taken from the event RenderWorldLastEvent //you can just put the partial ticks in your function call if you dont want to render from the same //function that you subscribe to the event system. //starts ogl rendering and things GL11.glPushMatrix(); //makes sure we get the right type of render GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glLineWidth(6); //translates your draw space to wherever you are GL11.glTranslated(-playerX, -playerY, -playerZ); GL11.glColor3ub((byte)253,(byte)0,(byte)0); //sets our draw focus relaltive to us. Just a stupid little variable. In this case, //I'm drawing a line at 9,9,9. However, you can just draw whatever you want using what //-ever coordinates you choose. float mx = 9; float my = 9; float mz = 9; //drawing stuff. OGL should have a text draw function, as well as texture rendering. //you'll have to look up how to import textures and stuff with ogl. //also, you'll need to learn more about ogl. It's probably worth it in the end. GL11.glEnable(GL11.GL_LINE_SMOOTH); GL11.glHint( GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST ); GL11.glBegin(GL11.GL_LINE_STRIP); GL11.glVertex3f(mx,my,mz+1f); GL11.glVertex3f(mx,my,mz-1f); GL11.glEnd(); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glPopMatrix(); } You'll also need to learn a little about forge events and how they're handled. It's good experience though.
  11. Assuming you know a little about forge/mcp, I'd say start in net.minecraft.server.MinecraftServer. Theres a function "func_82010_a" that should be able to help you get list of players. edit: dangit hydro
  12. Please, by all means, take your time. I'm sure you'd be able to send it to me faster than I could learn/ figure out how to code it lol
  13. To be honest though, that might have just been the hosting. In any case, if I ever plan to release this mod, I'm not too sure I would want to have to package it with forge essentials :\ To many unwanted functions imo
  14. Forge essentials seemed a bit heavy when I last used it on a forge server... And on top of that, all I would want is one function that would be used client side. The mod I'm making is a client-utility, and doesn't even have a serverside As far as yours goes, I would very much like a link and/or permission to use whatever you have I'm not too experienced in forge/mcp yet, so I wouldn't really understand how to make a coremod to support a block break event
  15. I'm writing a mod that needs to make logs of broken blocks; Keepcalm's block break API would be perfect for the event I need, but it hasn't been updated in seven months, and implements interfaces that have been removed. So Does anybody know any good block break event or api (coremod?) for 1.6.2 forge?
×
×
  • Create New...

Important Information

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