Refactoring & cleaning
This commit is contained in:
parent
874559c21e
commit
e5736669ca
200 changed files with 1382 additions and 1596 deletions
36
src/main/java/techreborn/utils/InitUtils.java
Normal file
36
src/main/java/techreborn/utils/InitUtils.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
package techreborn.utils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
public class InitUtils {
|
||||
public static <I extends Item> I setup(I item, String name) {
|
||||
item.setRegistryName(new ResourceLocation(TechReborn.MOD_ID, name));
|
||||
item.setTranslationKey(TechReborn.MOD_ID + "." + name);
|
||||
item.setCreativeTab(TechReborn.TAB);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static <I extends Item> I setupIngredient(I item, String name, String type) {
|
||||
item.setRegistryName(new ResourceLocation(TechReborn.MOD_ID, name + "_" + type));
|
||||
item.setTranslationKey(TechReborn.MOD_ID + "." + type + "." + name);
|
||||
item.setCreativeTab(TechReborn.TAB);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static <B extends Block> B setup(B block, String name) {
|
||||
block.setRegistryName(new ResourceLocation(TechReborn.MOD_ID, name));
|
||||
block.setTranslationKey(TechReborn.MOD_ID + "." + name);
|
||||
block.setCreativeTab(TechReborn.TAB);
|
||||
return block;
|
||||
}
|
||||
|
||||
public static <B extends Block> B setupIngredient(B block, String name, String type) {
|
||||
block.setRegistryName(new ResourceLocation(TechReborn.MOD_ID, name + "_" + type));
|
||||
block.setTranslationKey(TechReborn.MOD_ID + "." + type + "." + name);
|
||||
block.setCreativeTab(TechReborn.TAB);
|
||||
return block;
|
||||
}
|
||||
}
|
|
@ -1,43 +1,9 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.utils;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.init.TRIngredients;
|
||||
import techreborn.TechReborn;
|
||||
|
||||
public class TechRebornCreativeTab extends CreativeTabs {
|
||||
|
||||
public static TechRebornCreativeTab instance = new TechRebornCreativeTab();
|
||||
|
||||
public TechRebornCreativeTab() {
|
||||
super("techreborn");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack createIcon() {
|
||||
return TRIngredients.Parts.MACHINE_PARTS.getStack();
|
||||
}
|
||||
public class TechRebornCreativeTab {
|
||||
//todo: remove
|
||||
public static CreativeTabs instance = TechReborn.TAB;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue