Skip to content

Commit

Permalink
Magma Branding
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexeption committed Aug 18, 2019
1 parent b13da95 commit 930ffac
Show file tree
Hide file tree
Showing 28 changed files with 53 additions and 75 deletions.
22 changes: 11 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ apply plugin: 'net.minecraftforge.gradle.launch4j'
apply plugin: 'net.nemerosa.versioning'
apply plugin: "com.github.breadmoirai.github-release"

group 'kettlefoundation'
group 'magmafoundation'
version 'git-' + versioning.info.branch + "-" + versioning.info.build

repositories {
Expand All @@ -55,8 +55,8 @@ repositories {
url 'https://mvnrepository.com/artifact/'
}
maven {
name 'KettleFoundation'
url 'https://repo.hexeption.co.uk/artifactory/Kettle/'
name 'MagmaFoundation'
url 'https://repo.hexeption.co.uk/artifactory/Magma/'
}
flatDir {
dirs 'src/main/resources'
Expand Down Expand Up @@ -110,7 +110,7 @@ minecraft {
with common
}

kettle {
magma {
rootDir "."
patchDir "patches/"
patchAfter "forge"
Expand Down Expand Up @@ -174,7 +174,7 @@ outputJar {
classifier = 'universal'

manifest.attributes([
"Implementation-Title": "Kettle",
"Implementation-Title": "Magma",
"Implementation-Version": version,
"Main-Class": "net.minecraftforge.fml.relauncher.ServerLaunchWrapper",
"TweakClass": "net.minecraftforge.fml.common.launcher.FMLTweaker",
Expand All @@ -187,8 +187,8 @@ processJson {
addReplacements([
"@minecraft_version@": project.minecraft.version,
"@version@": project.version,
"@project@": "kettle",
"@artifact@": "kf:kettle:${project.version}",
"@project@": "magma",
"@artifact@": "mf:magma:${project.version}",
"@universal_jar@": { outputJar.archiveName },
"@timestamp@": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
])
Expand All @@ -201,7 +201,7 @@ extractForgeSources {
genGradleProjects {
addCompileDep "junit:junit:4.12"
addCompileDep "bukkit:bukkit:1.12.2-R0.1"
addRepo("KettleFoundation", "https://repo.hexeption.co.uk/artifactory/Kettle/")
addRepo("MagmaFoundation", "https://repo.hexeption.co.uk/artifactory/Magma/")
}

import groovy.json.JsonSlurper
Expand Down Expand Up @@ -231,9 +231,9 @@ githubRelease {
}else{
token ""
}
owner "KettleFoundation"
repo "Kettle"
releaseName "Kettle Dev " + versioning.info.branch + "-" + versioning.info.build
owner "MagmaFoundation"
repo "Magma"
releaseName "Magma Dev " + versioning.info.branch + "-" + versioning.info.build
body {
"""\
## Setup Info
Expand Down
2 changes: 1 addition & 1 deletion patches/net/minecraft/block/BlockCake.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
else
{
player.addStat(StatList.CAKE_SLICES_EATEN);
+ // Kettle Restore CraftBukkit changes for AppleCore recognition
+ // Magma Restore CraftBukkit changes for AppleCore recognition
player.getFoodStats().addStats(2, 0.1F);
+ int oldFoodLevel = player.getFoodStats().foodLevel;
+
Expand Down
2 changes: 1 addition & 1 deletion patches/net/minecraft/block/BlockSkull.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
worldIn.setBlockState(pos, state, 4);
}
- this.dropBlockAsItem(worldIn, pos, state, 0);
+ // this.dropBlockAsItem(worldIn, pos, state, 0); Kettle - prevents doubled and creative mode drops
+ // this.dropBlockAsItem(worldIn, pos, state, 0); Magma - prevents doubled and creative mode drops

super.onBlockHarvested(worldIn, pos, state, player);
}
Expand Down
4 changes: 2 additions & 2 deletions patches/net/minecraft/entity/Entity.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
this.entityInit();
- net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EntityConstructing(this));
- capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this);
+ if(!(this instanceof EntityPlayer)) { // Kettle - move to EntityPlayer
+ if(!(this instanceof EntityPlayer)) { // Magma - move to EntityPlayer
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EntityConstructing(this));
+ capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this);
+ }
Expand All @@ -158,7 +158,7 @@
public boolean captureDrops = false;
public java.util.ArrayList<EntityItem> capturedDrops = new java.util.ArrayList<EntityItem>();
- private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities;
+ public net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities; // Kettle - private -> public
+ public net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities; // Magma - private -> public

public int getEntityId()
{
Expand Down
6 changes: 3 additions & 3 deletions patches/net/minecraft/entity/EntityLivingBase.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -512,18 +512,18 @@

if (!net.minecraftforge.common.ForgeHooks.onLivingDrops(this, cause, capturedDrops, i, recentlyHit > 0))
{
+ // Kettle start - first allow forge to alter drops, then plugins and finally spawn items
+ // Magma start - first allow forge to alter drops, then plugins and finally spawn items
+ if (capturedDrops.size() > 0) {
+ this.drops = new ArrayList<>();
+ // Kettle - don't use forceDrops
+ // Magma - don't use forceDrops
+ for(EntityItem item: capturedDrops)
+ {
+ this.drops.add(CraftItemStack.asCraftMirror(item.getItem()));
+ }
+ CraftEventFactory.callEntityDeathEvent(this, this.drops);
+ } else {
+ CraftEventFactory.callEntityDeathEvent(this);
+ // Kettle end
+ // Magma end
+ }
+
for (EntityItem item : capturedDrops)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public Container inventoryContainer;
public Container openContainer;
- protected FoodStats foodStats = new FoodStats();
+ protected FoodStats foodStats = new FoodStats(); // Kettle - Restore CraftBukkit modifications, compatible with AppleCore and other mods that modify FoodStats
+ protected FoodStats foodStats = new FoodStats(); // Magma - Restore CraftBukkit modifications, compatible with AppleCore and other mods that modify FoodStats
protected int flyToggleTimer;
public float prevCameraYaw;
public float cameraYaw;
Expand Down
2 changes: 1 addition & 1 deletion patches/net/minecraft/nbt/NBTTagList.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
NBTTagList nbttaglist = new NBTTagList();
nbttaglist.tagType = this.tagType;
-
+ if ( nbttaglist.tagList instanceof ArrayList) // Kettle, ensure we dont create arrays to then delete them
+ if ( nbttaglist.tagList instanceof ArrayList) // Magma, ensure we dont create arrays to then delete them
+ ((ArrayList<NBTBase>)nbttaglist.tagList).ensureCapacity(this.tagList.size());
for (NBTBase nbtbase : this.tagList)
{
Expand Down
4 changes: 2 additions & 2 deletions patches/net/minecraft/network/NetHandlerPlayServer.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1286,12 +1286,12 @@
+
+ InventoryView inventory = this.player.openContainer.getBukkitView();
+
+ // Kettle start
+ // Magma start
+ if(inventory == null){
+ inventory = new CraftInventoryView(this.player.getBukkitEntity(), MinecraftServer.getServerInstance().server.createInventory(this.player.getBukkitEntity(), InventoryType.CHEST), this.player.openContainer);
+ this.player.openContainer.setBukkitView(inventory);
+ }
+ // Kettle end
+ // Magma end
+
+ InventoryType.SlotType type = CraftInventoryView.getSlotType(inventory, packetIn.getSlotId());
+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
+ if(this.hasFMLMarker){
+ this.ip = this.ip.replace("\0FML\0", "");
+ }else if(this.ip.split("\0").length > 2){
+ this.hasFMLMarker = true; // Kettle - Bungee Support
+ this.hasFMLMarker = true; // Magma - Bungee Support
+ }
}

Expand Down
4 changes: 2 additions & 2 deletions patches/net/minecraft/server/MinecraftServer.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@
+ if (dim == 0) {
+ ISaveHandler idatamanager = new AnvilSaveHandler(server.getWorldContainer(), worldNameIn, true, this.dataFixer);
+ WorldInfo worlddata = idatamanager.loadWorldInfo();
+ // Kettle start
+ // Magma start
+ for (Map.Entry<ResourceLocation, Item> entry : ForgeRegistries.ITEMS.getEntries()) {
+ ResourceLocation key = entry.getKey();
+ Item item = entry.getValue();
Expand Down Expand Up @@ -454,7 +454,7 @@
+ PotionEffectType.stopAcceptingRegistrations();
+ server.loadPlugins();
+ server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.STARTUP);
+ // Kettle end
+ // Magma end
+ if (worlddata == null) {
+ worlddata = new WorldInfo(worldsettings, worldNameIn);
+ }
Expand Down
6 changes: 3 additions & 3 deletions patches/net/minecraft/server/management/PlayerList.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@
+ // CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleInventoryCloseEvent(playerIn);
+ if(playerIn.connection != null) {
+ // Kettle CraftServer Changed to Bukkit
+ // Magma CraftServer Changed to Bukkit
+ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(playerIn), "\u00A7e" + playerIn.getName() + " left the game");
+ Bukkit.getPluginManager().callEvent(playerQuitEvent);
+ playerIn.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());
Expand Down Expand Up @@ -584,15 +584,15 @@

- entityplayermp.connection.sendPacket(new SPacketRespawn(entityplayermp.dimension, entityplayermp.world.getDifficulty(), entityplayermp.world.getWorldInfo().getTerrainType(), entityplayermp.interactionManager.getGameType()));
+ int actualDimension = worldserver.provider.getDimension();
+ // Kettle - change dim for bukkit added dimensions
+ // Magma - change dim for bukkit added dimensions
+ if (DimensionManager.isBukkitDimension(actualDimension))
+ {
+ FMLEmbeddedChannel serverChannel = ForgeNetworkHandler.getServerChannel();
+ serverChannel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.PLAYER);
+ serverChannel.attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(entityplayermp);
+ serverChannel.writeOutbound(new DimensionRegisterMessage(actualDimension, DimensionManager.getProviderType(actualDimension).name()));
+ }
+ // Kettle end
+ // Magma end
+
+ // entityplayermp.connection.sendPacket(new SPacketRespawn(entityplayermp.dimension, entityplayermp.world.getDifficulty(), entityplayermp.world.getWorldInfo().getTerrainType(), entityplayermp.interactionManager.getGameType()));
+ entityplayermp.connection.sendPacket(new SPacketRespawn(actualDimension, worldserver.getDifficulty(), worldserver.getWorldInfo().getTerrainType(), entityplayermp.interactionManager.getGameType()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
{
- return input;
- }
+ return com.google.common.util.concurrent.Futures.getUnchecked(updateGameprofile(input, com.google.common.base.Predicates.alwaysTrue(), true)); // Kettle
+ return com.google.common.util.concurrent.Futures.getUnchecked(updateGameprofile(input, com.google.common.base.Predicates.alwaysTrue(), true)); // Magma
}

public int getSkullType()
2 changes: 1 addition & 1 deletion patches/net/minecraft/util/FoodStats.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
+ public int foodTimer;
+ public int prevFoodLevel = 20;

+ public EntityPlayer player; // CraftBukkit // Kettle private - public entityplayer - player Fix mcp duplicate naming causes AppleCore to recognize errors
+ public EntityPlayer player; // CraftBukkit // Magma private - public entityplayer - player Fix mcp duplicate naming causes AppleCore to recognize errors
+
+ public FoodStats() {
+ }
Expand Down
4 changes: 2 additions & 2 deletions patches/net/minecraft/world/World.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
+ this.isRemote = client;
+ this.worldBorder = providerIn.createWorldBorder();
+ perWorldStorage = new MapStorage(null);
+ // Kettle start
+ // Magma start
+ if (DimensionManager.getWorld(0) != null) // if overworld has loaded, use its mapstorage
+ {
+ this.mapStorage = DimensionManager.getWorld(0).mapStorage;
Expand All @@ -212,7 +212,7 @@
+ generator = this.getServer().getGenerator(this.worldInfo.getWorldName());
+ getWorld().generator = generator;
+ }
+ // Kettle end
+ // Magma end
+ // CraftBukkit start
+ getWorldBorder().world = (WorldServer) this;
+ // From PlayerList.setPlayerFileData
Expand Down
4 changes: 2 additions & 2 deletions patches/net/minecraft/world/WorldProvider.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
return true;
}
+
+ // Kettle start
+ // Magma start
+ public static WorldProvider getProviderForDimension(int dimensionId){
+ return DimensionManager.createProviderFor(dimensionId);
+ }
+ // Kettle end
+ // Magma end
}
2 changes: 1 addition & 1 deletion patches/net/minecraft/world/WorldServer.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@
{
IChunkLoader ichunkloader = this.saveHandler.getChunkLoader(this.provider);
- return new ChunkProviderServer(this, ichunkloader, this.provider.createChunkGenerator());
+ // Kettle - if provider is vanilla, proceed to create a bukkit compatible chunk generator
+ // Magma - if provider is vanilla, proceed to create a bukkit compatible chunk generator
+ if (this.provider.getClass().toString().length() <= 3 || this.provider.getClass().toString().contains("net.minecraft")) {
+ // CraftBukkit start
+ org.bukkit.craftbukkit.generator.InternalChunkGenerator gen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
}

- if (this.id2ChunkMap.isEmpty()) net.minecraftforge.common.DimensionManager.unloadWorld(this.world.provider.getDimension());
+ // Kettle - Stops forge automatically unloading world on startup.
+ // Magma - Stops forge automatically unloading world on startup.
+// if (this.id2ChunkMap.isEmpty()) net.minecraftforge.common.DimensionManager.unloadWorld(this.world.provider.getDimension());

this.chunkLoader.chunkTick();
Expand Down
6 changes: 3 additions & 3 deletions patches/net/minecraftforge/common/DimensionManager.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
usedIds.add(id);
}
+
+ // Kettle - register Environment to Bukkit
+ // Magma - register Environment to Bukkit
+ if (id != -1 && id != 0 && id != 1) // ignore vanilla
+ {
+ registerBukkitDimension(id, type.getName());
Expand All @@ -64,7 +64,7 @@
}
else
{
+ FMLCommonHandler.instance().getMinecraftServerInstance().worldServerList.remove(getWorld(id)); // Kettle - remove world from our new world arraylist
+ FMLCommonHandler.instance().getMinecraftServerInstance().worldServerList.remove(getWorld(id)); // Magma - remove world from our new world arraylist
worlds.remove(id);
server.worldTickTimes.remove(id);
FMLLog.log.info("Unloading dimension {}", id);
Expand Down Expand Up @@ -130,7 +130,7 @@
- w.flush();
- setWorld(id, null, w.getMinecraftServer());
- }
+ FMLCommonHandler.instance().getMinecraftServerInstance().server.unloadWorld(w.getWorld(), true); // Kettle
+ FMLCommonHandler.instance().getMinecraftServerInstance().server.unloadWorld(w.getWorld(), true); // Magma
}
}

Expand Down
2 changes: 1 addition & 1 deletion patches/net/minecraftforge/common/ForgeHooks.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}

LOGGER.warn("Picking on: [{}] {} gave null item", new Object[] {this.objectMouseOver.typeOfHit, s});
@@ -993,7 +993,7 @@
@@ -992,7 +992,7 @@
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Container remoteGuiContainer = NetworkRegistry.INSTANCE.getRemoteGuiContainer(mc, entityPlayerMP, modGuiId, world, x, y, z);
if (remoteGuiContainer != null)
{
+ // Kettle start
+ // Magma start
+ if(remoteGuiContainer.getBukkitView() == null){
+ TileEntity te = entityPlayer.world.getTileEntity(new BlockPos(x,y,z));
+ if(te instanceof IInventory){
Expand All @@ -42,7 +42,7 @@
+ return;
+ }
+ }
+ // Kettle end
+ // Magma end
entityPlayerMP.getNextWindowId();
entityPlayerMP.closeContainer();
int windowId = entityPlayerMP.currentWindowId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package net.minecraftforge.fml.relauncher;

import java.lang.reflect.Method;
+import kettlefoundation.kettle.downloads.DownloadServerFiles;
+import org.magmafoundation.magma.downloads.DownloadServerFiles;

-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.core.LoggerContext;
Expand All @@ -19,7 +19,7 @@
public static void main(String[] args)
{
- new ServerLaunchWrapper().run(args);
+ System.out.println("Starting Kettle");
+ System.out.println("Starting Magma");
+ DownloadServerFiles.downloadMinecraftServer();
+ DownloadServerFiles.downloadServerLibraries();
+ new ServerLaunchWrapper().run(args);
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rootProject.name = 'kettle'
rootProject.name = 'Magma'

22 changes: 0 additions & 22 deletions src/main/java/kettlefoundation/kettle/KettleVersionCommand.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/org/bukkit/craftbukkit/CraftServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
import net.md_5.bungee.api.chat.BaseComponent;

public final class CraftServer implements Server {
private final String serverName = "Kettle";
private final String serverName = "Magma";
private final String serverVersion;
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
Expand Down
Loading

0 comments on commit 930ffac

Please sign in to comment.