sir_titi
Members-
Posts
58 -
Joined
-
Last visited
-
Days Won
1
Everything posted by sir_titi
-
haah really no prob mate, cuss i never forget, and sure not where i came from .(the hard times) you i'll hope for u 2, and make it the best project you can, and since you are the coder you also have the power. Greets
-
yea i know, i learned java and MC coding the hard way, doing it by myself. Maybe not the best way, but not that i am the best (hell no). But i'm proud of what i achieved and some times the best way is to look how MC did it :p. Hey and if you ever need more help feel free to ask!
-
oow srry mate, well the container is to sync the data to client, and the actual GUI is then used for rendering the GUI on the client
-
well for the container you should also make a new class (here an other example) public class ContainerRadio extends ContainerR2SMod{ private final TEBaseRadio te; EntityPlayer Speler; private int vorigeVolume=-1; private int VorigePlayingIndex=-1; public ContainerRadio(InventoryPlayer inventory,TEBaseRadio radio,EntityPlayer speler){ Speler=speler; this.te=radio; } @Override public void detectAndSendChanges() { checkPlayerSpecificVolume(); checkPlayerSpecificPlayingIndex(); super.detectAndSendChanges(); } @Override @SideOnly(Side.CLIENT) public void updateProgressBar(int id, int value) { super.updateProgressBar(id, value); switch(id){ case 0://volume te.setVolume(value); break; case 1: //te.musicspeler.SetPlayingIndex(value); break; } } public boolean canInteractWith(EntityPlayer speler) { return true; } /**checks if the current player (guiRadio opened) and sends to the player a message (id 5) to set the playerSpecificData on the corresponding client side *@author kevin (sir_titi) */ private void checkPlayerSpecificVolume(){ if(vorigeVolume!=te.getPlayerVolume(Speler)){ for (Object crafter :listeners) {//TODO CHECK FOR OLDER VERSIONS if(crafter instanceof EntityPlayerMP){ MessageHandler.sendTo(new MsgMusicVolume(te,te.getPlayerVolume(Speler)), (EntityPlayerMP) crafter); } } vorigeVolume=te.getPlayerVolume(Speler); } } private void checkPlayerSpecificPlayingIndex(){ if(VorigePlayingIndex!=te.getPlayerPlayingIndex(Speler)){ for(Object crafter : listeners){//TODO CHECK FOR OLDER VERSIONS if(crafter instanceof EntityPlayerMP){ MessageHandler.sendTo(new MsgMusicPlayIndex(te, te.getPlayerPlayingIndex(Speler)),(EntityPlayerMP) crafter); } } VorigePlayingIndex=te.getPlayerPlayingIndex(Speler); } } } the "ContainerR2SMod" is Container
-
aah that i don't know I always make my own stuff, so yea can't help you with that but i do think it should work if you returned the MC Gui instead but i'm not sure, feel free to test it out
-
[1.10] Help Moving Living Entities Asymmetrically
sir_titi replied to FlamingVikingGoat's topic in Modder Support
maybe this can help you public boolean itemInteractionForEntity(ItemStack itemstack,EntityPlayer playerIn, EntityLivingBase doel, EnumHand hand) { if(!doel.world.isRemote){ doel.motionY = 0.3; if (isgeladen(itemstack.getItemDamage())){ doel.motionX = (doel.posX - playerIn.posX)*2; doel.motionZ = (doel.posZ - playerIn.posZ)*2; itemstack.setItemDamage(0); }else{ itemstack.setItemDamage(itemstack.getItemDamage()+1); } } return false; } -
yea no prob mate , best off luck to you .Let's hope you fix it. (fingers crossed)
-
well that's alot off work for me mate but to keep it simple (this is for the Client) switch(ID){//just switch the "GUI" id's and return the proper GUI class and that's it :p case Constante.guiRadio: if(tileentity instanceof TERadio){ return new GuiRadio(speler.inventory,speler,(TERadio)tileentity,wereld,x,y,z); } break; case Constante.guiJukeBox: if(tileentity instanceof TEjukeBox){ return new GuiJukeBox(speler.inventory,speler,(TEjukeBox)tileentity,wereld,x,y,z); } break; } throw new IllegalArgumentException("["+Constante.MODNAME+"] no Correct GUI ID : "+ID); and the server switch(ID){//the same but here you should return the container case Constante.guiRadio: if(tileentity instanceof TERadio){ return new ContainerRadio(speler.inventory,(TERadio)tileentity,speler); } break; case Constante.guiJukeBox: if(tileentity instanceof TEjukeBox){ return new ContainerRadio(speler.inventory,(TEjukeBox)tileentity,speler); } break; } throw new IllegalArgumentException("["+Constante.MODNAME+"] no Correct GUI ID "+ID);
-
haah normally nope :p, but these just handle you GUI's nothing more
-
good luck, but wait a sec i give you the needed stuff from scratch. public class R2S_GuiHandler implements IGuiHandler { public Object getClientGuiElement(int ID, EntityPlayer speler, World wereld,int x, int y, int z) { } public Object getServerGuiElement(int ID, EntityPlayer speler, World wereld, int x, int y, int z) { } these are the important method's
-
yea sure but i'm pretty sure you will have to change allot And normally no you don't have to change anything there.
-
yes that is correct i do this also
-
well if you have a Gui that has a "container" yea you will need that. wait a sec public class R2S_GuiHandler implements IGuiHandler { private GameSettings sets; /**test public void onKeyInput(InputEvent.KeyInputEvent event, EntityPlayer speler, World wereld,int x, int y, int z) { if(ToetsenBinden.pong.isPressed()) speler.openGui(R2S_UsefulBlocks.instance, 1, wereld, x, y, z); } **/ public enum GUIIDS{ guiRadio; } public Object getClientGuiElement(int ID, EntityPlayer speler, World wereld,int x, int y, int z) { TileEntity tileentity = wereld.getTileEntity(new BlockPos(x, y, z)); // speler.getPersistentID(); /**if(ToetsenBinden.inventaries.isPressed()){ System.out.println("test bctGuihandler guiharnas"); speler.openGui(R2S_UsefulBlocks.instance, Constante.guiHarnas, wereld, x, y, z);} **/ /*switch(GUIIDS.values()[ID]){ case guiRadio: if(tileentity instanceof TERadio){ return new GuiRadio(speler.inventory,(TERadio)tileentity); } }*/ switch(ID){ case Constante.guiRadio: if(tileentity instanceof TERadio){ return new GuiRadio(speler.inventory,speler,(TERadio)tileentity,wereld,x,y,z); } break; case Constante.guiJukeBox: if(tileentity instanceof TEjukeBox){ return new GuiJukeBox(speler.inventory,speler,(TEjukeBox)tileentity,wereld,x,y,z); } break; } throw new IllegalArgumentException("["+Constante.MODNAME+"] no Correct GUI ID : "+ID); } public Object getServerGuiElement(int ID, EntityPlayer speler, World wereld, int x, int y, int z) { TileEntity tileentity = wereld.getTileEntity(new BlockPos(x, y, z)); //speler.getPersistentID(); /**if (ToetsenBinden.inventaries.isPressed()){ System.out.println("test bctGuihandler guiharnas"); speler.openGui(R2S_UsefulBlocks.instance, Constante.guiHarnas, wereld, x, y, z);} **/ /*switch(GUIIDS.values()[ID]){ case guiRadio: if(tileentity instanceof TERadio){ return new ContainerRadio(speler.inventory,(TERadio)tileentity); } }*/ switch(ID){ case Constante.guiRadio: if(tileentity instanceof TERadio){ return new ContainerRadio(speler.inventory,(TERadio)tileentity,speler); } break; case Constante.guiJukeBox: if(tileentity instanceof TEjukeBox){ return new ContainerRadio(speler.inventory,(TEjukeBox)tileentity,speler); } break; } throw new IllegalArgumentException("["+Constante.MODNAME+"] no Correct GUI ID "+ID); } /**public static void InventariesInit(EntityPlayer speler,World wereld,int x,int y, int z){ if (ToetsenBinden.inventaries.isPressed()) System.out.println("toets inventaries werkt"); FMLNetworkHandler.openGui(speler, R2S_UsefulBlocks.instance,Constante.guiRadio, wereld, x, y, z); if(Keyboard.isKeyDown(25)) System.out.println("lol key25"); }**/ } this is a direct copy if my class hope you have enough
-
haha LOL well pretty easy in your "onBlockActivated" you have a World param well use that as follows if (wereld.isRemote){//is client }else{//is server }
-
did you make a class that implements "IGuiHandler"
-
did you call this on server side cuss this should work
-
no in your case in your onBlockActivated(args)
-
in your constructor (or where you want :p), just add this and set it to 0 setHardness(0F); and for the GUI maybe this might help you FMLNetworkHandler.openGui(args); normally that should fix all your issues Greets Sir_titi
-
If i may, i do render a block that uses more than one block space. But i did use both blocks (not for the rendering), only the bottom block renders the model, and i don't have any lighting issues :s. And this is all done by rendering thru the JSON thingy :p. Simply said i don't rendering anything when it's the "top" block. So my ques (since we don't have any code) there is something else that is causing the lighting issues for you model
-
I do this maybe it's because you haven't added the full location (if it is local). dependencies { compile files("C:/Users/user/ModEnviroment/Modding1.12.2/r2s-Core/bin"){ builtBy 'compile' } }
-
and you are implementing "ITileEntityProvider"? cuss those method's you call are not recommended implement the interface i said and use those method's that have the Blockstate instead of the meta And yea i know but hey! Make a wrapper method and you no longer see that :p.
-
well i use eclipse but you have to make sure the "library" is in the built path.
-
you should make sure in you block you have the method's hasTileEntity() (although not sure if this is needed), and also createTileEntity().
-
well yes that is true for openGL stuff, but that is to what i know, if you pop the let's say the matrix everything in that matrix will be canceled. But i may be wrong about that . Anyways glad to be able to help And for the translating back that could be useful if you have some other parts that need to be rendered. but yea if it works for you sure go ahead . And to be honest i don't use the Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModel I made my own method's to render the models Greets Sir_titi