Skip to content

Commit

Permalink
Recommit, Almost nuked everything last time 🐝
Browse files Browse the repository at this point in the history
  • Loading branch information
MFernflower committed May 18, 2015
1 parent d58a442 commit fc7c521
Show file tree
Hide file tree
Showing 11 changed files with 186 additions and 2 deletions.
2 changes: 0 additions & 2 deletions LICENSE

This file was deleted.

2 changes: 2 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Try and contact original owner about my changes
Contact current owner of BuildCraft (Adrian)
51 changes: 51 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}

apply plugin: 'forge'

version = "1.7.10-0.1a"
group= "mods.alice.gp" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "glasspipes"

minecraft {
version = "1.7.10-10.13.2.1236"
assetDir = "eclipse/assets"
}

dependencies {
runtime files('libs/buildcraft-6.4.15-dev.jar')
}

processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version

// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'

// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}

// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
11 changes: 11 additions & 0 deletions src/main/java/mods/alice/gp/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package mods.alice.gp;

import buildcraft.transport.TransportProxyClient;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.client.MinecraftForgeClient;

public final class ClientProxy extends ServerProxy {
public void forgeInitialization(FMLInitializationEvent event) {
MinecraftForgeClient.registerItemRenderer(GlassPipe.INSTANCE.pipeItemGlass, TransportProxyClient.pipeItemRenderer);
}
}
43 changes: 43 additions & 0 deletions src/main/java/mods/alice/gp/GlassPipe.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package mods.alice.gp;
// This is in no way the work of Mandrake and Dr.Zed and the original author is free to use what I contributed.
import buildcraft.core.CreativeTabBuildCraft;
import buildcraft.transport.BlockGenericPipe;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import mods.alice.gp.transport.pipe.PipeItemsGlass;
import net.minecraft.item.Item;

@Mod(modid="bc_glasspipe", name="Glass Pipes Mod", version="0.1a", dependencies="required-after:Forge@[10.13.2.1230,);required-after:BuildCraft|Transport")
public final class GlassPipe {

@Mod.Instance("bc_glasspipe")
public static GlassPipe INSTANCE;

// Not certain what this does (if anyone knows please do say)
@Mod.Metadata("bc_glasspipe")
private ModMetadata meta;
//
@SidedProxy(clientSide="mods.alice.gp.ClientProxy", serverSide="mods.alice.gp.ServerProxy")
public static ServerProxy PROXY;
public Item pipeItemGlass;

@Mod.EventHandler
public void forgePreInitialization(FMLPreInitializationEvent event) {
meta.description = "Adds frictionless item transport pipes for BuildCraft.";
meta.url = "http://a1lic.net/";
meta.authorList.add("alice");
meta.credits = "alice";
meta.autogenerated = false;
pipeItemGlass = BlockGenericPipe.registerPipe(PipeItemsGlass.class, CreativeTabBuildCraft.PIPES);
pipeItemGlass.setUnlocalizedName("PipeItemsGlass");
PROXY.forgePreInitialization(event);
}

@Mod.EventHandler
public void forgeInitialization(FMLInitializationEvent event) {
PROXY.forgeInitialization(event);
}
}
23 changes: 23 additions & 0 deletions src/main/java/mods/alice/gp/ServerProxy.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package mods.alice.gp;

import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.oredict.ShapedOreRecipe;

import java.util.List;

@SuppressWarnings("unchecked")
public class ServerProxy {
public void forgePreInitialization(FMLPreInitializationEvent event) {
CraftingManager craft = CraftingManager.getInstance();

List<IRecipe> recipeList = craft.getRecipeList();

recipeList.add(new ShapedOreRecipe(new ItemStack(GlassPipe.INSTANCE.pipeItemGlass, 24), "GDG", 'G', "blockGlass", 'D', "gemDiamond"));
}

public void forgeInitialization(FMLInitializationEvent event) {}
}
21 changes: 21 additions & 0 deletions src/main/java/mods/alice/gp/transport/pipe/PipeGPIconProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package mods.alice.gp.transport.pipe;

import buildcraft.api.core.IIconProvider;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;

public final class PipeGPIconProvider implements IIconProvider {
public static final PipeGPIconProvider INSTANCE = new PipeGPIconProvider();

private IIcon glassPipe;


public IIcon getIcon(int iconIndex) {
return this.glassPipe;
}


public void registerIcons(IIconRegister iconRegister) {
this.glassPipe = iconRegister.registerIcon("bc_glasspipe:pipeItemsGlass");
}
}
31 changes: 31 additions & 0 deletions src/main/java/mods/alice/gp/transport/pipe/PipeItemsGlass.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package mods.alice.gp.transport.pipe;

import buildcraft.api.core.IIconProvider;
import buildcraft.transport.Pipe;
import buildcraft.transport.PipeTransportItems;
import buildcraft.transport.pipes.events.PipeEventItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.Item;
import net.minecraftforge.common.util.ForgeDirection;

public final class PipeItemsGlass extends Pipe<PipeTransportItems>{
public PipeItemsGlass(Item item) {
super(new PipeTransportItems(), item);
}


@SideOnly(Side.CLIENT)
public IIconProvider getIconProvider() {
return PipeGPIconProvider.INSTANCE;
}


public int getIconIndex(ForgeDirection direction) {
return 0;
}

public void eventHandler(PipeEventItem.AdjustSpeed event) {
event.handled = true;
}
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/bc_glasspipe/lang/en_US.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
item.PipeItemsGlass.name=Glass Transport Pipe
tip.PipeItemsGlass=Frictionless item transport
2 changes: 2 additions & 0 deletions src/main/resources/assets/bc_glasspipe/lang/ja_JP.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
item.PipeItemsGlass.name=アイテムパイプ(ガラス)
tip.PipeItemsGlass=移動速度が減衰しない
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fc7c521

Please sign in to comment.