Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Commit 93db953

Browse files
Merge pull request #1 from CMSC-389E/1.15.x
1.15.x
2 parents 5745e11 + 481b445 commit 93db953

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+914
-1965
lines changed

.gitignore

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
.gradle
2-
.settings
3-
bin
4-
doc
1+
.*
52
gradle
63
run
7-
.classpath
8-
.project
9-
*.launch
104
gradlew
11-
gradlew.bat
5+
gradlew.bat
6+
*.launch

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Jamie
3+
Copyright (c) 2020 Jamie Brassel
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

Node.psd

-26.9 KB
Binary file not shown.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# CMSC-389E-Circuitry
22

3-
This is the source code for the Circuitry mod, created for class <a href="https://www.cs.umd.edu/~abrassel/">CMSC 389E</a>. Every class is available to view, entirely unobfuscated. For the time being, it will be kept up-to-date with current commits.
3+
This is the source code for the CMSC 389E Circuitry mod, created for UMD class CMSC 389E. Every class is available to view, entirely unobfuscated. For the time being, it will be kept up-to-date with current commits.
44

55
However, having this code available is not to be used to cheat or take advantage of. It is only here for academic purposes, debugging, and a means to effectively collaborate on this project.
66

7-
More information on the class and what you are expected to do can be found <a href="http://www.cs.umd.edu/class/spring2020/cmsc389E/">here</a>.
7+
More information on the class and what you are expected to do can be found <a href="https://cs.umd.edu/class/fall2020/cmsc389E">here</a>.

build.gradle

Lines changed: 49 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,59 @@
11
buildscript {
2-
repositories {
3-
jcenter()
4-
maven {
5-
url = "http://files.minecraftforge.net/maven"
2+
repositories {
3+
maven {
4+
url = 'https://files.minecraftforge.net/maven'
65
}
7-
}
6+
7+
jcenter()
8+
mavenCentral()
9+
}
810

9-
dependencies {
10-
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
11-
}
11+
dependencies {
12+
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '+', changing: true
13+
}
1214
}
1315

14-
apply plugin: 'net.minecraftforge.gradle.forge'
15-
version = "1.12.2-1.0.1.0"
16-
group = "cmsc3893.circuitry"
17-
archivesBaseName = "circuitry"
18-
sourceCompatibility = targetCompatibility = '1.8'
16+
apply plugin: 'net.minecraftforge.gradle'
17+
apply plugin: 'eclipse'
18+
version = '1.15.2-1.0.0.0'
19+
group = 'cmsc389e.circuitry'
20+
archivesBaseName = 'circuitry'
21+
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
22+
compileJava.options.compilerArgs << '-proc:none'
1923

20-
compileJava {
21-
sourceCompatibility = targetCompatibility = '1.8'
22-
options.compilerArgs << '-parameters'
24+
minecraft {
25+
mappings channel: 'snapshot', version: '20200514-1.15.1'
26+
27+
runs {
28+
client {
29+
workingDirectory project.file('run')
30+
31+
mods {
32+
circuitry.source sourceSets.main
33+
}
34+
}
35+
36+
server {
37+
workingDirectory project.file('run')
38+
39+
mods {
40+
circuitry.source sourceSets.main
41+
}
42+
}
43+
}
2344
}
2445

25-
minecraft {
26-
version = "1.12.2-14.23.5.2768"
27-
runDir = "run"
28-
mappings = "stable_39"
29-
makeObfSourceJar = false
46+
dependencies {
47+
minecraft 'net.minecraftforge:forge:1.15.2-31.2.0'
48+
compile 'org.apache.httpcomponents:httpmime:+'
3049
}
3150

32-
processResources {
33-
inputs.property "version", project.version
34-
inputs.property "mcversion", project.minecraft.version
35-
36-
from(sourceSets.main.resources.srcDirs) {
37-
include 'mcmod.info'
38-
expand 'version':project.version, 'mcversion':project.minecraft.version
39-
}
40-
41-
from(sourceSets.main.resources.srcDirs) {
42-
exclude 'mcmod.info'
43-
}
44-
}
51+
jar.manifest.attributes (
52+
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
53+
'Implementation-Title': project.name,
54+
'Implementation-Vendor': project.archivesBaseName,
55+
'Implementation-Version': "${version}",
56+
'Specification-Title': project.name,
57+
'Specification-Vendor': project.archivesBaseName,
58+
'Specification-Version': "${version}"
59+
)
Lines changed: 66 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,78 @@
11
package cmsc389e.circuitry;
22

3-
import cmsc389e.circuitry.common.IProxy;
4-
import cmsc389e.circuitry.common.command.CommandAbort;
5-
import cmsc389e.circuitry.common.command.CommandLoad;
6-
import cmsc389e.circuitry.common.command.CommandSet;
7-
import cmsc389e.circuitry.common.command.CommandTest;
8-
import cmsc389e.circuitry.common.network.CircuitryPacketHandler;
9-
import net.minecraft.command.ServerCommandManager;
3+
import java.util.ArrayList;
4+
5+
import cmsc389e.circuitry.common.Config;
6+
import cmsc389e.circuitry.common.NodeTileEntity;
7+
import cmsc389e.circuitry.common.block.InNodeBlock;
8+
import cmsc389e.circuitry.common.block.OutNodeBlock;
9+
import net.minecraft.block.Block;
10+
import net.minecraft.client.gui.ChatLine;
11+
import net.minecraft.client.gui.NewChatGui;
12+
import net.minecraft.item.BlockItem;
13+
import net.minecraft.item.Item;
14+
import net.minecraft.item.Item.Properties;
15+
import net.minecraft.item.ItemGroup;
16+
import net.minecraft.tileentity.TileEntityType;
17+
import net.minecraft.tileentity.TileEntityType.Builder;
18+
import net.minecraftforge.eventbus.api.IEventBus;
19+
import net.minecraftforge.eventbus.api.SubscribeEvent;
20+
import net.minecraftforge.fml.RegistryObject;
1021
import net.minecraftforge.fml.common.Mod;
11-
import net.minecraftforge.fml.common.Mod.EventHandler;
12-
import net.minecraftforge.fml.common.SidedProxy;
13-
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
14-
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
15-
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
22+
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
23+
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
24+
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
25+
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
26+
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
27+
import net.minecraftforge.registries.DeferredRegister;
28+
import net.minecraftforge.registries.ForgeRegistries;
1629

17-
/**
18-
* Mod class for CMSC 389E Circuitry.
19-
*/
20-
@Mod(modid = Circuitry.MODID, version = "1.12.2-1.0.1.0", useMetadata = true, updateJSON = "https://raw.githubusercontent.com/JamieBrassel/CMSC-389E-Circuitry/master/update.json")
30+
@Mod(Circuitry.MODID)
31+
@EventBusSubscriber(bus = Bus.MOD)
2132
public class Circuitry {
2233
public static final String MODID = "circuitry";
23-
@SidedProxy(clientSide = "cmsc389e.circuitry.client.ClientProxy", serverSide = "cmsc389e.circuitry.server.ServerProxy")
24-
private static IProxy proxy;
2534

26-
/**
27-
* Called while Minecraft Forge is initializing during mod startup.<br>
28-
* Currently, this method calls {@link CircuitryPacketHandler#init()} and
29-
* {@link IProxy#init(FMLInitializationEvent)}.
30-
*
31-
* @param event the {@link FMLInitializationEvent}
32-
*/
33-
@EventHandler
34-
public static void init(FMLInitializationEvent event) {
35-
CircuitryPacketHandler.init();
36-
proxy.init(event);
37-
}
35+
private static final DeferredRegister<Block> BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, MODID);
36+
private static final DeferredRegister<TileEntityType<?>> TES = new DeferredRegister<>(ForgeRegistries.TILE_ENTITIES,
37+
MODID);
38+
39+
public static final RegistryObject<Block> IN_NODE = BLOCKS.register("in_node", InNodeBlock::new),
40+
OUT_NODE = BLOCKS.register("out_node", OutNodeBlock::new);
41+
public static final RegistryObject<TileEntityType<?>> NODE = TES.register("node",
42+
() -> Builder.create(NodeTileEntity::new, IN_NODE.get(), OUT_NODE.get()).build(null));
43+
44+
@SuppressWarnings("resource")
45+
@SubscribeEvent
46+
public static void onClientSetup(FMLClientSetupEvent event) {
47+
ObfuscationReflectionHelper.setPrivateValue(NewChatGui.class,
48+
event.getMinecraftSupplier().get().ingameGUI.getChatGUI(), new ArrayList<ChatLine>() {
49+
private boolean frozen;
3850

39-
/**
40-
* Called while Minecraft Forge is post-initializing during mod startup.<br>
41-
* Currently, this method just calls
42-
* {@link IProxy#postInit(FMLPostInitializationEvent)}.
43-
*
44-
* @param event the {@link FMLPostInitializationEvent event}
45-
*/
46-
@EventHandler
47-
public static void postInit(FMLPostInitializationEvent event) {
48-
proxy.postInit(event);
51+
@Override
52+
public ChatLine remove(int index) {
53+
frozen = true;
54+
return get(index);
55+
}
56+
57+
@Override
58+
public int size() {
59+
int size = frozen ? 0 : super.size();
60+
frozen = false;
61+
return size;
62+
}
63+
}, "field_146253_i"); // drawnChatLines
4964
}
5065

51-
/**
52-
* Called while the logical server is starting up, but before it is started.<br>
53-
* Currently, this method registers {@link CommandAbort /abort},
54-
* {@link CommandLoad /load}, {@link CommandSet /set}, and {@link CommandTest
55-
* /test}.
56-
*
57-
* @param event the {@link FMLServerStartingEvent}
58-
*/
59-
@EventHandler
60-
public static void serverStart(FMLServerStartingEvent event) {
61-
ServerCommandManager commandManager = (ServerCommandManager) event.getServer().getCommandManager();
62-
commandManager.registerCommand(new CommandAbort());
63-
commandManager.registerCommand(new CommandLoad());
64-
commandManager.registerCommand(new CommandSet());
65-
commandManager.registerCommand(new CommandTest());
66+
public Circuitry() {
67+
DeferredRegister<Item> items = new DeferredRegister<>(ForgeRegistries.ITEMS, MODID);
68+
BLOCKS.getEntries().forEach(block -> items.register(block.getId().getPath(),
69+
() -> new BlockItem(block.get(), new Properties().group(ItemGroup.REDSTONE))));
70+
71+
IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();
72+
BLOCKS.register(bus);
73+
TES.register(bus);
74+
items.register(bus);
75+
76+
Config.register();
6677
}
6778
}

src/main/java/cmsc389e/circuitry/client/ClientProxy.java

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)