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

Commit

Permalink
356 stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
quat1024 committed Sep 4, 2018
1 parent 220d6b5 commit ba3fede
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 279 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ build
# other
eclipse
run

libs/
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@ A Botania addon that adds more toys for your corporea system. Designed for manag

Development status - first version is out, now thinking of more things to add to it ;)

---

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

---

This project uses a small amount of code from Gotta Go Fast by Thiakil, specifically, its ASM classwriter. Its license is reproduced in OTHER_LICENCES.md.

### Sounds cool what does it add
## Sounds cool what does it add

* A Corporea Spark Tinkerer to swap out spark networks
* An Item Frame Tinkerer to switch items on Item Frames
Expand Down Expand Up @@ -46,3 +38,30 @@ This project uses a small amount of code from Gotta Go Fast by Thiakil, specific
* "Data boxes"
* The little worldgen structure thingie.
* MORE COREMODDING????!??!!

## Build instructions

This mod depends on a very new version of Botania, which I couldn't find on any particular Mavens.

* Download Botania version 356 from CurseForge
* Run it through a tool like BON2 using `snapshot_20180407` mappings
* Create a directory named `libs` alongside `src`, `gradle` etc
* Put the deobfuscated Botania jar inside the `libs` directory
* Build as usual

The buildscript also contains a few handy lines that allow you to set your Minecraft username and UUID when you launch your dev instance. This is useful for debugging things like soul cores. You must set neither or both, or else Minecraft will get really confused.

* Discover your Minecraft UUID using a tool like https://mcuuid.net/
* Create a file called `gradle.properties` in your Gradle home directory (on Windows at least, it's in `C:/Users/<username>/.gradle`)
* Format the file like this:

mc_uuid=873dea16-d058-4343-861c-f62c21da124b
mc_username=quaternary

* Save, and launch the game through the usual methods

## License information

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

This project uses a small amount of code from Gotta Go Fast by Thiakil, specifically, its ASM classwriter. Its license is reproduced in OTHER_LICENCES.md.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ repositories {
}

dependencies {
deobfCompile "vazkii.botania:Botania:r1.10-355.4"
//Building from the libs folder for now (see README)
//deobfCompile "vazkii.botania:Botania:r1.10-355.4"
deobfCompile "com.azanor.baubles:Baubles:1.12-1.5.2"
}

Expand Down
47 changes: 47 additions & 0 deletions src/main/java/quaternary/incorporeal/etc/CorporeaInputHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package quaternary.incorporeal.etc;

import com.mojang.authlib.GameProfile;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import quaternary.incorporeal.tile.soulcore.TileCorporeaSoulCore;
import vazkii.botania.api.corporea.CorporeaHelper;
import vazkii.botania.api.corporea.CorporeaIndexRequestEvent;
import vazkii.botania.api.corporea.InvWithLocation;

import java.util.ArrayList;
import java.util.List;

@Mod.EventBusSubscriber
public class CorporeaInputHandler {
@SubscribeEvent
public static void corporeaInput(CorporeaIndexRequestEvent e) {
World world = e.requester.world;

//Look for any corporea soul cores on the network
List<GameProfile> soulCoreProfiles = new ArrayList<>();
for(InvWithLocation inv : CorporeaHelper.getInventoriesOnNetwork(e.indexSpark)) {
TileEntity tile = world.getTileEntity(inv.pos);
if(tile instanceof TileCorporeaSoulCore) {
soulCoreProfiles.add(((TileCorporeaSoulCore)tile).getOwnerProfile());
}
}

//No soul cores on this network? Ok.
if(soulCoreProfiles.isEmpty()) return;

//Some soul cores on this network? Check for a matching one
GameProfile playerProfile = e.requester.getGameProfile();
for(GameProfile profile : soulCoreProfiles) {
if(profile.equals(playerProfile)) return;
}

//Couldn't find a matching one? Display an error message and cancel the event
e.requester.sendMessage(new TextComponentTranslation("incorporeal.etc.noSoulCore").setStyle(new Style().setColor(TextFormatting.RED)));
e.setCanceled(true);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*
* While it would be useful to extend Botania's WrappedIInventory, its constructor is private.
* Most of this class is therefore just copied from it. */
//TODO the PR allows extending WrappedIInventory now~
//I dont feel like dealing with these messy functions though lmaO
public class LyingWrappedInventory extends WrappedInventoryBase {
private final InvWithLocation inv;

Expand Down
18 changes: 0 additions & 18 deletions src/main/java/quaternary/incorporeal/etc/SacrificialGoat.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public IncorporealCoreModContainer() {
super(new ModMetadata());
ModMetadata meta = getMetadata(); //Thanks java requiring super to be first

meta.version = "1.0.0";
meta.version = "1.1.0";
meta.modId = "incorporeal_core";
meta.name = "In-core-poreal";
meta.name = "Incoremod-poreal";
meta.credits = "Your MOM";
meta.authorList = ImmutableList.of("quaternary");
meta.description = "Don't mind me, just a little coremod used by Incorporeal!";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import quaternary.incorporeal.spookyasm.tweaks.AbstractTweak;
import quaternary.incorporeal.spookyasm.tweaks.CorporeaInhibitorTweak;
import quaternary.incorporeal.spookyasm.tweaks.InventoryWrapTweak;
import quaternary.incorporeal.spookyasm.tweaks.RetainerComparatorTweak;
import quaternary.incorporeal.spookyasm.tweaks.TerribleHorribleNoGoodVeryBadAwfulCorporeaIndexInputHandlerTweak;
import quaternary.incorporeal.spookyasm.tweaks.*;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -25,8 +21,6 @@ public class IncorporealTransformer implements IClassTransformer, Opcodes {
static {
allTweaks.add(new InventoryWrapTweak());
allTweaks.add(new CorporeaInhibitorTweak());
allTweaks.add(new RetainerComparatorTweak());
allTweaks.add(new TerribleHorribleNoGoodVeryBadAwfulCorporeaIndexInputHandlerTweak());

for(AbstractTweak tweak : allTweaks) {
patches.addAll(tweak.getAffectedClassNames());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

public abstract class AbstractTweak implements Opcodes {
protected abstract String describe(String transformedName);
protected abstract List<String> getAffectedClassNamesImpl();
protected abstract List<String> computeAffectedClassNames();
protected abstract void patch(ClassNode node, String transformedName);

private List<String> cache = null;
public List<String> getAffectedClassNames() {
if(cache == null) cache = getAffectedClassNamesImpl();
if(cache == null) cache = computeAffectedClassNames();
return cache;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected String describe(String transformedName) {
}

@Override
protected List<String> getAffectedClassNamesImpl() {
protected List<String> computeAffectedClassNames() {
return ImmutableList.of("vazkii.botania.common.entity.EntityCorporeaSpark");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected String describe(String transformedName) {
}

@Override
protected List<String> getAffectedClassNamesImpl() {
protected List<String> computeAffectedClassNames() {
return ImmutableList.of("vazkii.botania.common.core.handler.InternalMethodHandler");
}

Expand Down

This file was deleted.

Loading

0 comments on commit ba3fede

Please sign in to comment.