mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 02:45:13 +00:00
Snipe some todos
This commit is contained in:
1 parent
7db5f1fb61
commit
aed98aaded
3 files changed
+27
-11
No files matched your search
@@ -13,8 +13,10 @@ package vazkii.botania.client.core.handler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -35,14 +37,11 @@ public class CorporeaInputHandler {
|
||||
/** Filter for usable guis to handle requests. Added to in JEIBotaniaPlugin */
|
||||
public static Predicate<GuiScreen> supportedGuiFilter = gui -> gui instanceof GuiContainer;
|
||||
|
||||
/* todo 1.13
|
||||
@SubscribeEvent
|
||||
public static void buttonPressed(KeyboardInputEvent.Post event) {
|
||||
public static void buttonPressed(GuiScreenEvent.KeyboardKeyPressedEvent event) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if(mc.world == null || !supportedGuiFilter.test(mc.currentScreen)
|
||||
|| Keyboard.getEventKey() != ClientProxy.CORPOREA_REQUEST.getKeyCode()
|
||||
|| !Keyboard.getEventKeyState()
|
||||
|| Keyboard.isRepeatEvent()
|
||||
|| ClientProxy.CORPOREA_REQUEST.isActiveAndMatches(InputMappings.getInputByCode(event.getKeyCode(), event.getScanCode()))
|
||||
|| TileCorporeaIndex.InputHandler.getNearbyIndexes(mc.player).isEmpty())
|
||||
return;
|
||||
|
||||
@@ -59,8 +58,7 @@ public class CorporeaInputHandler {
|
||||
count = max / 2;
|
||||
|
||||
if(count > 0) {
|
||||
String name = CorporeaHelper.stripControlCodes(stack.getDisplayName());
|
||||
String full = count + " " + name;
|
||||
String full = count + " " + stack.getDisplayName().getString();
|
||||
|
||||
mc.ingameGUI.getChatGUI().addToSentMessages(full);
|
||||
mc.player.sendChatMessage(full);
|
||||
@@ -68,7 +66,6 @@ public class CorporeaInputHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
private static ItemStack getStackUnderMouse() {
|
||||
GuiScreen screen = Minecraft.getInstance().currentScreen;
|
||||
|
||||
@@ -24,6 +24,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
@@ -85,9 +86,21 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary,
|
||||
return false;
|
||||
|
||||
if(getBlockState().getBlock() == ModBlocks.defaultAltar && stack.getItem() == Item.getItemFromBlock(Blocks.VINE)) {
|
||||
// todo 1.13 this resets the tile entity/drops all contents
|
||||
world.setBlockState(getPos(), ModBlocks.mossyAltar.getDefaultState());
|
||||
ItemStack[] tmp = new ItemStack[getSizeInventory()];
|
||||
for(int i = 0; i < getSizeInventory(); i++) {
|
||||
tmp[i] = itemHandler.getStackInSlot(i);
|
||||
itemHandler.setStackInSlot(i, ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
stack.shrink(1);
|
||||
world.setBlockState(getPos(), ModBlocks.mossyAltar.getDefaultState());
|
||||
|
||||
TileEntity newAltar = world.getTileEntity(getPos());
|
||||
if(newAltar instanceof TileAltar) {
|
||||
for(int i = 0; i < getSizeInventory(); i++) {
|
||||
((TileAltar) newAltar).getItemHandler().setStackInSlot(i, tmp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.crafting;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
@@ -94,7 +95,12 @@ public final class ModManaAlchemyRecipes {
|
||||
swampFolliageRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.VINE), Ingredient.fromItems(Blocks.LILY_PAD), 320));
|
||||
|
||||
fishRecipes = new ArrayList<>();
|
||||
// todo 1.13 fishRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.FISH, 1, i == 3 ? 0 : i + 1), Ingredient.fromTag(ItemTags.FISHES), 200));
|
||||
Item[] fishes = { Items.COD, Items.SALMON, Items.TROPICAL_FISH, Items.PUFFERFISH };
|
||||
for(int i = 0; i < fishes.length; i++) {
|
||||
Ingredient in = Ingredient.fromItems(fishes[i]);
|
||||
ItemStack out = new ItemStack(i == fishes.length - 1 ? fishes[0] : fishes[i + 1]);
|
||||
fishRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(out, in, 200));
|
||||
}
|
||||
|
||||
cropRecipes = new ArrayList<>();
|
||||
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.WHEAT_SEEDS), Ingredient.fromItems(Items.COCOA_BEANS), 6000));
|
||||
|
||||
Reference in new issue
Block a user