Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Commit

Permalink
🤔 🤔 🤔
Browse files Browse the repository at this point in the history
  • Loading branch information
quat1024 committed Sep 22, 2019
1 parent 3876a7c commit 1f79f60
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import quaternary.incorporeal.api.IDocumentableComponent;
import quaternary.incorporeal.api.IIncorporealAPI;

import javax.annotation.Nullable;
Expand All @@ -16,11 +17,12 @@
* as well as a few miscellaneous functions relating to gameplay.
*
* @see IIncorporealAPI#getCygnusDatatypeRegistry()
* @see IDocumentableComponent
*
* @author quaternary
* @since 1.1
*/
public interface ICygnusDatatype<T> {
public interface ICygnusDatatype<T> extends IDocumentableComponent {
/**
* @return The class that this Cygnus serializer is in charge of.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ public static void document() {
"incorporeal:textures/lexicon/funnel/index.png",
"botania.page.incorporeal.cygnus_funnel.index"
),
new PageFunnelable(
new ItemStack(CygnusNetworkItems.MASTER_CYGNUS_SPARK),
"incorporeal:textures/lexicon/funnel/master_cygnus_spark.png",
"botania.page.incorporeal.cygnus_funnel.master_cygnus_spark"
),
new PageFunnelable(
new ItemStack(Blocks.FLOWER_POT),
"botania.page.incorporeal.cygnus_funnel.item_entity.heading",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public class CygnusNetworkLexicon extends LexiconModule {
public static final List<Consumer<List<LexiconPage>>> FUNNELABLE_DOCUMENTERS = new ArrayList<>();

public static LexiconEntry CYGNUS_BASICS;
public static LexiconEntry CYGNUS_SPARKS;
public static LexiconEntry CYGNUS_TYPES;

public static LexiconEntry CYGNUS_SPARKS;
public static LexiconEntry CYGNUS_FUNNEL;
public static LexiconEntry CYGNUS_TICKET;

public static LexiconEntry CYGNUS_WORD;
public static LexiconEntry CYGNUS_CRYSTAL_CUBE;
Expand All @@ -48,25 +48,27 @@ public static void register() {
///

CYGNUS_BASICS = justTextEntry("cygnus_basics", ItemStack.EMPTY, category, knowledge, 5).setPriority();
CYGNUS_TYPES = justTextEntry("cygnus_types", ItemStack.EMPTY, category, knowledge, 1).setPriority();

CYGNUS_SPARKS = skytouchingEntry(CygnusNetworkItems.MASTER_CYGNUS_SPARK, CygnusSkytouchingRecipes.masterCygnusSpark, category, knowledge, 3);
CYGNUS_SPARKS.setLexiconPages(new PageSkytouching("asdfghjkl", CygnusSkytouchingRecipes.cygnusSpark));
CYGNUS_SPARKS.addExtraDisplayedRecipe(new ItemStack(CygnusNetworkItems.CYGNUS_SPARK));

CYGNUS_FUNNEL = skytouchingEntry(CygnusNetworkBlocks.FUNNEL, CygnusSkytouchingRecipes.cygnusFunnel, category, knowledge, 3);

//TODO: *remove* this crafting recipe, make it use a funnelable and you just shove data onto a sheet of paper
//CYGNUS_TICKET

CYGNUS_WORD = skytouchingEntry(CygnusNetworkBlocks.WORD, CygnusSkytouchingRecipes.cygnusWord, category, knowledge, 3);

CYGNUS_CRYSTAL_CUBE = skytouchingEntry(CygnusNetworkBlocks.CRYSTAL_CUBE, CygnusSkytouchingRecipes.cygnusCrystalCube, category, knowledge, 3);

CYGNUS_RETAINER = skytouchingEntry(CygnusNetworkBlocks.RETAINER, CygnusSkytouchingRecipes.cygnusRetainer, category, knowledge, 2);
CYGNUS_RETAINER = skytouchingEntry(CygnusNetworkBlocks.RETAINER, CygnusSkytouchingRecipes.cygnusRetainer, category, knowledge, 3);

///

List<LexiconPage> pages = new ArrayList<>();
CygnusRegistries.DATATYPES.forEach(t -> t.document(pages));
pages.forEach(CYGNUS_TYPES::addPage);

pages.clear();
FUNNELABLE_DOCUMENTERS.forEach(d -> d.accept(pages));
CygnusRegistries.LOOSE_FUNNELABLES.forEach(l -> l.document(pages));
pages.forEach(CYGNUS_FUNNEL::addPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void renderScreen(IGuiLexiconEntry gui, int mx, int my) {

GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1F, 1F, 1F, 1F);
GlStateManager.color(1F, 1F, 1F, 0.2F);
//move it down compared to original
Gui.drawModalRectWithCustomSizedTexture(gui.getLeft() + 15, gui.getTop() + 38, 0, 0, 128, 128, 128, 128);
//((GuiScreen) gui).drawTexturedModalRect(gui.getLeft() + 15, gui.getTop() + 38, 0, 0, 128, 128);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
import quaternary.incorporeal.api.cygnus.ICygnusDatatype;
import quaternary.incorporeal.api.cygnus.ICygnusStack;
import quaternary.incorporeal.feature.cygnusnetwork.CygnusError;
import vazkii.botania.api.lexicon.LexiconPage;
import vazkii.botania.common.lexicon.page.PageText;

import javax.annotation.Nullable;
import java.math.BigInteger;
import java.util.List;

public class CygnusBigIntegerType implements ICygnusDatatype<BigInteger> {
@Override
Expand Down Expand Up @@ -92,4 +95,9 @@ public int toComparator(BigInteger item) {
if(item.compareTo(FIFTEEN) > 0) return 15;
else return item.intValue();
}

@Override
public void document(List<LexiconPage> pages) {
pages.add(new PageText("botania.page.incorporeal.cygnus_types.biginteger"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import quaternary.incorporeal.core.etc.helper.CorporeaHelper2;
import vazkii.botania.api.corporea.CorporeaHelper;
import vazkii.botania.api.corporea.CorporeaRequest;
import vazkii.botania.api.lexicon.LexiconPage;
import vazkii.botania.common.lexicon.page.PageText;

import java.io.IOException;
import java.util.List;
Expand Down Expand Up @@ -141,4 +143,9 @@ public int toComparator(CorporeaRequest item) {
int x = CorporeaHelper.signalStrengthForRequestSize(item.count);
return x == 0 ? 1 : x;
}

@Override
public void document(List<LexiconPage> pages) {
pages.add(new PageText("botania.page.incorporeal.cygnus_types.corporea_request"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import net.minecraftforge.fml.relauncher.SideOnly;
import quaternary.incorporeal.api.cygnus.ICygnusDatatype;
import quaternary.incorporeal.feature.cygnusnetwork.CygnusError;
import vazkii.botania.api.lexicon.LexiconPage;
import vazkii.botania.common.lexicon.page.PageText;

import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -86,4 +88,9 @@ public CygnusError readFromPacketBuffer(PacketBuffer buf) {
public boolean areEqual(CygnusError item1, CygnusError item2) {
return item1.errorTranslationKey.equals(item2.errorTranslationKey) && Arrays.deepEquals(item1.errorFormat, item2.errorFormat);
}

@Override
public void document(List<LexiconPage> pages) {
pages.add(new PageText("botania.page.incorporeal.cygnus_types.error"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import quaternary.incorporeal.api.cygnus.ICygnusDatatype;
import quaternary.incorporeal.feature.cygnusnetwork.CygnusDatatypeHelpers;
import quaternary.incorporeal.feature.cygnusnetwork.CygnusStack;
import vazkii.botania.api.lexicon.LexiconPage;
import vazkii.botania.common.lexicon.page.PageText;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -111,4 +113,9 @@ public String toString(CygnusStack item) {
public int toComparator(CygnusStack item) {
return MathHelper.clamp(item.depth(), 1, 15);
}

@Override
public void document(List<LexiconPage> pages) {
pages.add(new PageText("botania.page.incorporeal.cygnus_types.stack"));
}
}
21 changes: 19 additions & 2 deletions src/main/resources/assets/incorporeal/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ botania.page.incorporeal.cygnus_basics2=The &4Cygnus Network&0 is essentially a
botania.page.incorporeal.cygnus_basics3=A &4stack&0 data structure is like a list, but only the &4top&0 items of the list can be accessed. &4Pushing&0 data onto the stack puts it above the &4top&0 of the stack and it becomes the new &4top&0. &4Popping&0 data from the stack removes it from the stack; whatever was below becomes the new &4top&0. There's no way to push or pop data from the &4middle&0 or &4bottom&0 of the stack, besides moving whatever's above it &4out of the way&0 first.
botania.page.incorporeal.cygnus_basics4=&4Cygnus-aligned things&0 can manipulate the stack. The &1Funnel&0 can copy real-world signals as &4data&0 onto the stack or interpret data on the stack as &4real-world signals&0. &1Words&0 perform &4functions&0 on the stack, and &1Crystal Cubes&0 test &4conditions&0 against the stack. &1Retainers&0 and &1Tickets&0 store data off-stack in the forms of &4blocks&0 and &4items&0. See their respective &1Lexica Botania&0 entries for more information.

botania.entry.incorporeal.cygnus_types=Cygnus Datatypes
botania.tagline.incorporeal.cygnus_types=What can you put on the stack?
botania.page.incorporeal.cygnus_types0=There are a few different &4types&0 of data that can be put on the &4stack&0 associated with a &1Master Cygnus Spark&0. Some actions make sense on all &4types&0 of data (like &1Cygnus Word: Duplicate&0 or injecting into a &1Cygnus Retainer&0), but most actions are only defined for one &4type&0. Trying to perform a typed action while the top of the &4stack&0 contains data of the wrong &4type&0 will push a &3Type mismatch&0 error onto the &4stack&0.
botania.page.incorporeal.cygnus_types.biginteger=The &3Integer&0 datatype represents a positive or negative whole number. Many &1Cygnus Words&0 are available to add, subtract, and multiply these numbers. The number can be up to 50 digits long (not counting the minus sign, if any) - actions which produce a number larger than that will instead produce an &3Invalid math operation&0 error.
botania.page.incorporeal.cygnus_types.corporea_request=The &3Corporea Request&0 datatype represents a request for items from a &4Corporea Network&0. It is a bundle of a &4matcher&0 (the name or identity of the item being requested) and a numeric count. The &3Corporea Request&0 datatype is able to express "identity" style requests from &1Corporea Funnels&0, as well as "by name" requests from &1Corporea Indices&0.
botania.page.incorporeal.cygnus_types.error=The &3Error&0 datatype represents some computation error. Generally, these are pushed instead of the result of a computation when the action was not successful. Trying to add two non-numbers pushes a &3Type mismatch&0, trying to duplicate the top item of an empty &4stack&0 pushes a &3Stack underflow&0, dividing by zero pushes an &3Invalid math operation&0, and so on.
botania.page.incorporeal.cygnus_types.stack=The &3Cygnus Stack&0 datatype represents another Cygnus &4stack&0, packaged as a single item. These can be packaged and unpackaged by &4sourcing&0 from or &4sinking&0 into a &1Cygnus Master Spark&0 with a &1Cygnus Funnel&0.

botania.entry.incorporeal.master_cygnus_spark=Cygnus Sparks
botania.tagline.incorporeal.master_cygnus_spark=Data on the stack
botania.page.incorporeal.master_cygnus_spark0=Placing a &1Master Cygnus Spark&0 defines the center of a &4Cygnus network&0. It is home to a &4Cygnus Stack&0: a collection of up to sixteen units of &4Cygnus data&0. &1Master Cygnus Sparks&0 can be placed anywhere, and the contents of the &4stack&0 will display above it. Wearing a &1Manaseer Monocle&0 will cause the stack's contents to show through walls!
Expand All @@ -252,8 +260,17 @@ botania.page.incorporeal.cygnus_funnel1=If the &1Cygnus Funnel&0 has a &1Cygnus
botania.page.incorporeal.cygnus_funnel2=Generally, when &4sourcing&0 data from the world, the &1Cygnus Funnel&0 is non-destructive - it will source a &4copy&0 of whatever it sees. However, when &4sourcing&0 from another &4Cygnus&0-aligned source such as a &1Cygnus Retainer&0 or &1Corporea Retainer&0, the data is destroyed after being sourced.
# 745 sticky
botania.page.incorporeal.cygnus_funnel.flavor=Already broke, and it's only 7:45 in the morning
botania.page.incorporeal.cygnus_funnel.retainer=&4Sourcing&0 from a &1Corporea Retainer&0 returns the retained request. &4Sinking&0 into a &1Corporea Retainer&0 injects a new request with the same position.

botania.page.incorporeal.cygnus_funnel.retainer=&4Sourcing&0 from a &1Corporea Retainer&0 returns the retained &3Corporea Request&0. &4Sinking&0 a &3request&0 injects it, keeping the position.
botania.page.incorporeal.cygnus_funnel.crystal_cube=&4Sourcing&0 from a &1Corporea Crystal Cube&0 returns a &3Corporea Request&0 for the displayed item and count. &4Sinking&0 a &3request&0 sets the item (not the count).
botania.page.incorporeal.cygnus_funnel.funnel=&4Sinking&0 a &3Corporea Request&0 into a &1Corporea Funnel&0 makes it perform the request.
botania.page.incorporeal.cygnus_funnel.index=&4Sinking&0 a &3Corporea Request&0 into a &1Corporea Index&0 makes it perform the request.
botania.page.incorporeal.cygnus_funnel.master_cygnus_spark=&4Sourcing&0 from a &1Master Cygnus Spark&0 packages up its &4stack&0 into a &3Stack&0. &4Sinking&0 a &3stack&0 pushes it all on.
botania.page.incorporeal.cygnus_funnel.item_entity.heading=Dropped Items
botania.page.incorporeal.cygnus_funnel.item_entity=&4Sourcing&0 from any &1dropped items&0 returns a &3Corporea Request&0 for them, with count.
botania.page.incorporeal.cygnus_funnel.paper=&4Sinking&0 &3any data at all&0 into &1Paper&0 stores the data as a &1Cygnus Ticket&0.
botania.page.incorporeal.cygnus_funnel.ticket=&4Sourcing&0 from a &1Corporea Ticket&0 returns the stored &3data&0 and clears the ticket. &4Sinking&0 &3anything at all&0 overwrites the data.
botania.page.incorporeal.cygnus_funnel.repeater=&4Sourcing&0 from a &1Redstone Repeater&0 returns a &3number&0 between 1 and 4 representing the delay on the repeater. &4Sinking&0 a &3number&0 between 1 and 4 sets the delay.
botania.page.incorporeal.cygnus_funnel.redstone_dust=&4Sourcing&0 from &1Redstone Dust&0 returns a &3number&0 between 0 and 15 representing its power level.

# Cygnus

Expand Down

0 comments on commit 1f79f60

Please sign in to comment.