本文整理汇总了Java中codechicken.nei.NEIClientConfig类的典型用法代码示例。如果您正苦于以下问题:Java NEIClientConfig类的具体用法?Java NEIClientConfig怎么用?Java NEIClientConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NEIClientConfig类属于codechicken.nei包,在下文中一共展示了NEIClientConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: keyTyped
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
public boolean keyTyped(final GuiContainer guiContainer, final char c, final int i) {
final int keyBinding = NEIClientConfig.getKeyBinding("gui.xu_ping");
if (i != keyBinding) {
return false;
}
final LayoutManager layout = LayoutManager.instance();
if (layout == null || LayoutManager.itemPanel == null || NEIClientConfig.isHidden()) {
return false;
}
final ItemStack stackMouseOver = GuiContainerManager.getStackMouseOver(guiContainer);
if (stackMouseOver == null || stackMouseOver.getItem() == null) {
return false;
}
NetworkHandler.sendPacketToServer(new PacketNEIPing(stackMouseOver));
return true;
}
示例2: forgeShapedRecipe
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
public CachedShapedRecipe forgeShapedRecipe(ShapedOreRecipe recipe) {
int width;
int height;
try {
width = ReflectionManager.getField(ShapedOreRecipe.class, Integer.class, recipe, 4);
height = ReflectionManager.getField(ShapedOreRecipe.class, Integer.class, recipe, 5);
} catch (Exception e) {
NEIClientConfig.logger.error("Error loading recipe", e);
return null;
}
Object[] items = recipe.getInput();
for (Object item : items)
if (item instanceof List && ((List<?>) item).isEmpty())//ore handler, no ores
return null;
return new CachedShapedRecipe(width, height, items, recipe.getRecipeOutput());
}
示例3: onGuiMouseEventpre
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
@SubscribeEvent (priority = EventPriority.LOWEST, receiveCanceled = true)//We need to be called before JEI.
public void onGuiMouseEventpre(MouseInputEvent.Pre event) {
if (Mouse.getEventButton() == -1 || event.getGui() == null || !Mouse.getEventButtonState()) {
return;
}
Point mouse = GuiDraw.getMousePosition();
int eventButton = Mouse.getEventButton();
if (JEIIntegrationManager.searchBoxOwner == EnumItemBrowser.JEI) {
GuiTextFieldFilter fieldFilter = JEIIntegrationManager.getTextFieldFilter();
if (fieldFilter != null && fieldFilter.isMouseOver(mouse.x, mouse.y)) {
if (eventButton == 0) {
if (fieldFilter.isFocused() && (System.currentTimeMillis() - lastSearchBoxClickTime < 500)) {//double click
NEIClientConfig.world.nbt.setBoolean("searchinventories", !SearchField.searchInventories());
NEIClientConfig.world.saveNBT();
lastSearchBoxClickTime = 0L;
} else {
lastSearchBoxClickTime = System.currentTimeMillis();
}
} else if (eventButton == 1) {
NEIClientConfig.setSearchExpression("", false);
LayoutManager.searchField.setText("", false);
}
}
}
}
示例4: handleServerSideCheck
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
/**
* Handles the servers ServerSideCheck.
* Checks both local and remote protocol versions for a mismatch.
* If no mismatch is found it does the following:
* Notifies ClientHandler of a world change.
* Resets all local data of that dimension.
* Requests the server for a LoginState.
* Finally it sets the availability of a ServerSide counterpart as true.
*
* @param serverProtocol The servers protocol version.
* @param worldName The dimension data to load.
* @param world The clients current world object.
*/
private void handleServerSideCheck(int serverProtocol, String worldName, World world) {
if (serverProtocol > NEIActions.protocol) {
NEIClientUtils.printChatMessage(new TextComponentTranslation("nei.chat.mismatch.client"));
} else if (serverProtocol < NEIActions.protocol) {
NEIClientUtils.printChatMessage(new TextComponentTranslation("nei.chat.mismatch.server"));
} else {
try {
ClientHandler.INSTANCE.loadWorld(world);
NEIClientConfig.loadWorld(getSaveName(worldName));
NEIClientConfig.setHasSMPCounterPart(true);
sendRequestLoginInfo();
} catch (Exception e) {
LogHelper.errorError("Error handling SMP Check", e);
}
}
}
示例5: renderLastEvent
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
@SubscribeEvent
public void renderLastEvent(RenderWorldLastEvent event) {
if (NEIClientConfig.isEnabled()) {
GlStateManager.pushMatrix();
GlStateTracker.pushState();
Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
RenderUtils.translateToWorldCoords(entity, event.getPartialTicks());
renderChunkBounds(entity);
renderMobSpawnOverlay(entity);
GlStateTracker.popState();
GlStateManager.popMatrix();
}
}
示例6: cheatItem
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
/**
* @param mode -1 = normal cheats, 0 = no infinites, 1 = replenish stack
*/
public static void cheatItem(ItemStack stack, int button, int mode) {
if (!canCheatItem(stack)) {
return;
}
if (mode == -1 && button == 0 && shiftKey() && NEIClientConfig.hasSMPCounterPart()) {
cheatItem(stack, button, 0);
} else if (button == 1) {
giveStack(stack, 1);
} else {
if (mode == 1 && stack.getCount() < stack.getMaxStackSize()) {
giveStack(stack, stack.getMaxStackSize() - stack.getCount());
} else {
int amount = getItemQuantity();
if (amount == 0) {
amount = stack.getMaxStackSize();
}
giveStack(stack, amount);
}
}
}
示例7: mouseUp
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
@Override
public void mouseUp(int mousex, int mousey, int button) {
ItemPanelSlot hoverSlot = getSlotMouseOver(mousex, mousey);
if (hoverSlot != null && hoverSlot.slotIndex == mouseDownSlot && draggedStack.isEmpty()) {
ItemStack item = hoverSlot.item;
if (!NEIClientConfig.canCheatItem(item)) {
if (button == 0) {
JEIIntegrationManager.openRecipeGui(item);
} else if (button == 1) {
JEIIntegrationManager.openUsageGui(item);
}
draggedStack = ItemStack.EMPTY;
mouseDownSlot = -1;
return;
}
NEIClientUtils.cheatItem(item, button, -1);
}
mouseDownSlot = -1;
}
示例8: loadHidden
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
public static void loadHidden() {
synchronized (hiddenItems) {
hiddenItems.clear();
}
List<ItemStack> itemList = new LinkedList<>();
try {
NBTTagList list = NEIClientConfig.world.nbt.getTagList("hiddenItems", 10);
for (int i = 0; i < list.tagCount(); i++) {
itemList.add(new ItemStack(list.getCompoundTagAt(i)));
}
} catch (Exception e) {
LogHelper.errorError("Error loading hiddenItems", e);
return;
}
synchronized (hiddenItems) {
for (ItemStack item : itemList) {
hiddenItems.add(item);
}
}
updateState.restart();
}
示例9: getPattern
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
public static Pattern getPattern(String search) {
switch (NEIClientConfig.getIntSetting("inventory.searchmode")) {
case 0://plain
search = "\\Q" + search + "\\E";
break;
case 1:
search = search.replace(".", "").replace("?", ".").replace("*", ".+?");
break;
}
Pattern pattern = null;
try {
pattern = Pattern.compile(search);
} catch (PatternSyntaxException ignored) {
}
return pattern == null || pattern.toString().length() == 0 ? null : pattern;
}
示例10: keyTyped
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
@Override
public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe)
{
if (keyCode == NEIClientConfig.getKeyBinding("gui.recipe"))
{
if (transferFluid(gui, recipe, false))
return true;
}
else if (keyCode == NEIClientConfig.getKeyBinding("gui.usage"))
{
if (transferFluid(gui, recipe, true))
return true;
}
return super.keyTyped(gui, keyChar, keyCode, recipe);
}
示例11: keyTyped
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
public boolean keyTyped(GuiContainer gui, char keyChar, int keyCode)
{
if (keyCode == NEIClientConfig.getKeyBinding("wiki"))
{
GuiContainerManager manager = GuiContainerManager.getManager(gui);
if(manager.getStackMouseOver() != null)
{
WikiLink.LogHelper.fine("WikiLink is connecting to online sources.");
long start = System.currentTimeMillis();
FMLClientHandler.instance().getClient().displayGuiScreen(new GuiContainerMenu(manager.getStackMouseOver()));
WikiLink.LogHelper.fine(String.format("WikiLink has connected to the Feed the Beast wiki, taking a total of %s milliseconds! :)", System.currentTimeMillis() - start));
WikiLink.LogHelper.fine("Note, if you are concerned with this connection speed, please do not contact the author of the mod. This problem can be fixed with a faster internet connection.");
}
}
return false;
}
示例12: lastKeyTyped
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
@Override
public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) {
if (!canHandle(gui))
return false;
if (keyCode == NEIClientConfig.getKeyBinding("gui.recipe"))
return transferRect(gui, false);
else if (keyCode == NEIClientConfig.getKeyBinding("gui.usage"))
return transferRect(gui, true);
return false;
}
示例13: load
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
public static void load(World world) {
OptionCycled modeOption = (OptionCycled) NEIClientConfig.getOptionList().getOption("inventory.cheatmode");
modeOption.parent.synthesizeEnvironment();
if(!modeOption.optionValid(modeOption.value())) {
modeOption.copyGlobals();
modeOption.cycle();
}
}
示例14: lastKeyTyped
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
@Override
public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) {
if (!canHandle(gui))
return false;
if (keyCode == NEIClientConfig.getKeyBinding("gui.recipe"))
return transferRect(gui, false);
else if (keyCode == NEIClientConfig.getKeyBinding("gui.usage"))
return transferRect(gui, true);
return false;
}
示例15: keyTyped
import codechicken.nei.NEIClientConfig; //导入依赖的package包/类
@Override
public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe) {
if (keyCode == NEIClientConfig.getKeyBinding("gui.recipe"))
return transferRect(gui, recipe, false);
else if (keyCode == NEIClientConfig.getKeyBinding("gui.usage"))
return transferRect(gui, recipe, true);
return false;
}