-
Posts
61 -
Joined
-
Last visited
-
Days Won
1
Everything posted by reapersremorse
-
?ill test it
-
ahh i do not have your 4 digit tag so i cant add you. mine is also my gamertag reapersremorse#1596 ill go ahead and reload and send you another pic //before pic after i shear the tree of all leaves
-
if you have discord, i can screenshare with ya
-
-
-
i didnt realize that, networking is currently beyond me. funny though, i have a cheaty set of items that are uncraftable. and this is the material i use and i get no errors or problems with it public static final Item.ToolMaterial MATERIAL_BASE = EnumHelper.addToolMaterial ( "material_base", 2147483647, -1, 2147483647.0f, 2147483647.0f, 2147483647 );
-
lol why would minecraft do that, it limits them in many ways.
-
if this is true, how do other mods use this number as their max in, like ee3/projecte and any mod that add energy storage??
-
oh my, i would have messed up some stuff if you did not tell me that...
-
lol i wasnt thinking, that would be useless and most useful at the same time. thanks ill fix that ive been using a util folder(package) and then adding all my over used stuff in there. ive always done things different than others... i was basing it off of max int, i just do not wanna accidentally create memory leaks or crash the game by going over max int, that 2Billion number is for the max number i would like to use as an int and its 10X more than anything that im ever going to add because of certain ideas i have for the future ;>
-
how is this? i believe i did this right, now to implement this class in all my other classes. i still need to add the common Strings,Floats,ints and doubles that my mod uses. BTW: sorry if the color scheme is weird for you. i edited all my editor colors to more suit my crazy mind. public final class Constants { //int burn values because mathsss public static final int nein = 1;//burn val 1 public static final int eighth = nein*25;//burn val 25 public static final int quarter = eighth*2;//burn val 50 public static final int stick = quarter*2;//burn val 100 public static final int one = stick*2;//burn val 200 normal furnace, 1item smelted public static final int coal = one*8;//burn val 1600 public static final int qs = coal*2;//burn val 3200 also charkite base value public static final int hs = qs*2;//burn val 6400 public static final int st = 12800;//burn val 12800 whole stack //block burn values public static final int block9 = coal*9;//burn val 14400 public static final int block4 = coal*4;//burn val public static final int Cblock9 = block9*2;//charkite block 9 ingots public static final int Cblock4 = block4*2;//charkite block 4 ingots //durability values public static final int MAXINT = 2147483647; //do not go past this limit public static final int MAXSAFEINT = 2000000000;//Max Durability for items and tools public static final int MAXDEVIDE = 200000000; // the number that should be the upper limit for any base things //used for random durability on spacific items public static final int MAXDURA = 8192;//Max int for durability public static final int MINDURA = 8;//Min durability for items and tools public static final int RANDURA = new Random().nextInt(MAXDURA-MINDURA)+MINDURA+1; //not in use yet //public constants for hopeful gui stuff in my manual public static final boolean YES = true; //confirm public static final boolean NO = false;//deny public static final boolean SUCCESS = true;//it worked public static final boolean FAILURE = false;//it failed public static final int INFINATE = -1;//infinate or not breakable value public static final String NEW_LINE = System.getProperty("line.separator"); //forces to another line public static final String FILE_SEPARATOR = System.getProperty("file.separator"); public static final String PATH_SEPARATOR = System.getProperty("path.separator"); public static final String EMPTY_STRING = "";//space without an actual space public static final String SPACE = " ";//space between words and such public static final String TAB = "\t";//tabs over in the text public static final String SINGLE_QUOTE = "'"; public static final String PERIOD = "."; public static final String DOUBLE_QUOTE = "\""; // private constants private Constants() { throw new AssertionError();//just testing the private stuffs } } im no longer using the interface, im just importing this class import static com.reapersremorse.uto.util.handlers.Constants.*; and i can use everything in the class without needing to import every value i use manually. i may start putting all my variables and over used functions in this class.
-
thank you both, i understand most of this. thank you for the description, im kind of an idiot XD so this helps me more than you know. im gonna try to mess with this when i get home.
-
My bad. I had bad information. Ill change it up when i get home. Im not near my pc, Could i use a constant to set different values for a random number?? I want to make an item that has a random durability/max uses every time its crafted. Im planning to add part casts and molds and i want to make them use 1 durability on every craft but have a random number attached every time its crafted or repaired. Could i use this type of information??? Public static final int[] RAND_DURA = new int[]{8,16,32,64,128,256}; Ive never messed with random int values before.
-
Sorry but i don't see what i did wrong. I was planning to make a class dedicated to my functions and variables. But this seems so much easier to use. Will this interface cause issues in the future if i keep using it?
-
if im not mistaken, a constant has to be passed again to declair it as either an int, double, float or other values. if im wrong, i could always change my code if it will work better than declairing variables in an interface that can be used in any class i add, also i can add more than just variables for math.
-
honestly i just wanted to see how useable it would be. it works the same and its less code.
-
because im just testing, its literally just holding information to use in other classes
-
i fixed my problem, i somehow had the same information in 2 seperate classes , one class was passing 0 to all items, and the other class was setting an int to the items i was trying to add a burnvalue to. ive gotten rid of the portion of code which makes all items have a value of 0 and now im able to add any item or block. i ended up making an interfce to hold some int values for me so i can easily add the burn values without me doing a lot of maths in my head public interface FuelHelperVariables { //int burn values because mathsss int nein = 1;//burn val 1 int eighth = nein*25;//burn val 25 int quarter = eighth*2;//burn val 50 int stick = quarter*2;//burn val 100 int one = stick*2;//burn val 200 normal furnace, 1item smelted int coal = one*8;//burn val 1600 int qs = coal*2;//burn val 3200 this is also the value for charkite int hs = qs*2;//burn val 6400 int st = hs*2;//burn val 12800 whole stack //block burn values int block9 = coal*9;//burn val 14400 int block4 = coal*4;//burn val } the chestplate is made with 8 charkite ingots, each ingot is double the value of coal so its set to qs*8 which is 25600 while my tools for this fuel are going to be special charkite axe returns qs*8+one //this is adding the ingots and sticks together for a burn value
-
public class BasicToolPrefabAxe extends ItemAxe implements IHasModel { public BasicToolPrefabAxe(String name,ToolMaterial material,String tool,int level,float AttackDamage,float AttackSpeed,int SetMaxStackSize) { super(material, AttackDamage, AttackSpeed); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.TOOLS); setHarvestLevel(tool,level); setMaxStackSize(SetMaxStackSize); BasicItemRegistry.ITEMS.add(this); } public void registerModels(){UTOMod.proxy.registerItemRenderer(this, 0, "inventory");} } in the first set of values, your setting the values that can be changed in other classes,
-
when i did that, it changed every item that uses that class. when i tried setting it as a variable, it would not work correctly. i only have one item class for items.
-
thank you, i honestly do not know another way to do it. when i tried to access the furnace class that handles fuel, this is all i could do. im just an idiot and im trying to learn while i make. but ive learned so much more while making this mod than i ever did when watching/reading and making those boring args classes..... im setting up mu github. i messed it up because i have more than 100 files...
-
yes i will setup github, i forgot about it honestly.
-
for some reason when i pasted the code, it did not copy the parenthesis and a few other things. this image is the class itself
-
i understand that, i was trying to get around that in the first place. i tried setting the constructor to look at a variable. the variable was not working as ive shown in past posts. this whole post is fool of code, showing the reason why i could not do what you told me to do. the closest ive gotten to comparing an item with my items or even setting a value to each item would be the code you referred to as ugly. i know it is ugly, but i got it to work, i was using the class below inorder to add my fuels when i started this, i just rewrote it. i stopped using this because i couldnt call items. i created this class because i feel i have no other option. i do not want to use the IFuelHandler because its depracated. this only works for blocks, it will not use my items this is the class that has the issues, but the issues happen because of the fuel handler. the fuel handler is deprecated. nothing i try works to add items without directly adding them to my main class like i showed you and you said well this is the class that i cant get to work, this is the class that made me go to this forum. this is the class that im having trouble with. ugly or not, this class is broken but only partially. i can give any block a fuel value. but when i try to add an item, it will not work. the code shows no signs of being in error for the items. the only error i get while adding fuel values is the error involving Warning:(7, 37) java: net.minecraftforge.fml.common.IFuelHandler in net.minecraftforge.fml.common has been deprecated Warning:(16, 43) java: net.minecraftforge.fml.common.IFuelHandler in net.minecraftforge.fml.common has been deprecated Warning:(16, 18) java: registerFuelHandler(net.minecraftforge.fml.common.IFuelHandler) in net.minecraftforge.fml.common.registry.GameRegistry has been deprecated line 7 is the import line 16 is {GameRegistry.registerFuelHandler(new IFuelHandler() public class FurnaceFuels public static void FurnaceFuelsGameRegistryregisterFuelHandlernew IFuelHandler@Override public int getBurnTime ItemStack //only the blocks work if ItemgetItemFromBlockBasicBlockRegistryBASE_BLOCKreturn 16000;//works else if ItemgetItemFromBlockBasicBlockRegistryBASE_BRICKreturn 100;//works else if ItemgetItemFromBlockBasicBlockRegistryBASE_BLOCK_GLASSreturn 200;//works //i have tried to add items, i can not get it to work. else if ItemgetByNameOrId"uto:base_ingot"return 1600;//does not work else if ItemgetByNameOrId"4523"return 400;//does not work else if BasicItemRegistryCRAFTING_ITEM return ;//does not work //else if (Item.getIdFromItem() == fuel.getItem()) return 32;//does not work at all return 0; ; by all intensive purposes, this code should work for the items but it only works when i get getItemFromBlock.
-
@diesieben07 first of all, i stated that im learning java while making this mod, second i tried that and it did not work. the game will not load it and when i add it correctly. it will give all my items the same burn value. that is why im trying to set it in my constructor. that is why im doing this in a way that makes no since. nevertheless im still trying, you only gain knowledge from experience and the tutorials for java are way too boring for me. ive learned mountains more while making this mod then i ever did while watching those tutorials and reading books. im not able to soak up the knowledge without doing something that is entertaining. and now that is out, i found a way to add the fuel values without adding to my items or block prefab classes. i enter a line in my main class under the init and it adds the value to the object within the game. {@Override public int getBurnTime(ItemStack fuel){if(Item.getItemFromBlock(BasicBlockRegistry.BASE_BLOCK) == fuel.getItem())return 16000;return 0;}});} in the game this makes it so my BASE_BLOCK has a burn value of 16000, same as coal block. itried to make a class outside of here to deal with this but when i do, it keeps argueing with me over the depracated classes used Warning:(14, 37) java: net.minecraftforge.fml.common.IFuelHandler in net.minecraftforge.fml.common has been deprecated this works but only when i use the depracated class within my init within my main class if i try this or anything revolved around adding a fuel in another class without directly stating what int to return, the mod will not run. just too restate i can use this in any class. @Override public int getItemBurnTime(ItemStack itemStack){return 16000;} but when i try to compare and convert from itemstack to int and dynamically call and set the int within another class. the game will not run and the game tells me exactly what you are saying but i cant get it to work that way without information i apparently do not know because i am not knowledgeable enough i must reiterate that the line of code ive added to my init in the main class is the only way ive been able to give any specified item or block a burn value without adding the same burn value to every item that the class is used for.